Hello,
U can use my generic parse function.
/*
Ex.:
X="33:33:33"
h=Token(X,8,1,":")
m=Token(X,8,2,":")
s=Token(X,8,3,":")
*/
Char * Token(Char *buffer, Int16 bufferLen, Int16 token, Char chrToken)
{
Char *target;
UInt16 offSetSource = 0;
UInt16 offSetTarget = 0;
UInt16 tokenCounter = 0;
target = (Char *)MemPtrNew(sizeof(Char)*bufferLen);
// MemSet((Char *)target, bufferLen,0);
while(offSetSource<bufferLen)
{
if(buffer[offSetSource] != chrToken)
{
target[offSetTarget++] = buffer[offSetSource];
}
else
{
if((++tokenCounter) == token)
{
target[offSetTarget] = '\0';
break;
}
else
{
offSetTarget = 0;
}
}
offSetSource++;
}
MemPtrFree(target);
return target;
}
----- Original Message -----
From: "Rania Saymeh" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Monday, November 26, 2001 6:46 PM
Subject: substrings
> hi all,
> if I have a time string in the following format, 11:22:00
> how can I divide it into substrings for hour, minute, seconds, when I use
> the StrStr function to get a substring using the ":" it keeps it with the
> number, is there some sort of function that specifies where my substring
> begins and ends..
> thanx in advance :)
> Rania
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/