All I am doing is getting a record from a database, putting it into a
string, counting and then want to chop it off a wTotalCount, but it keeps on
blowing up..

thanks
Ralph Krausse
*********************************************************

Word CListObject::_GetStringLastPos(CharPtr pszRecord)
{
        VoidHand vHandle = MemHandleNew(StrLen(pszRecord) + 1);
        CharPtr pNextChar  = (CharPtr)MemHandleLock(vHandle);
        MemMove(pNextChar,pszRecord,StrLen(pszRecord));

        int     wTotalCount     = 0;
        for(;*pNextChar;pNextChar++)
        {
                if(*pNextChar == '\"'  && *(pNextChar + 1) == ',' &&
*(pNextChar + 2) == '\"')
                {
                        break;
                }
                wTotalCount++;
        } 

        MemHandleUnlock(vHandle);
        MemHandleFree(vHandle);
        return wTotalCount;
}

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to