On Tue, 24 Apr 2001 13:26:33 -0400, "Gabriel Covert"
<[EMAIL PROTECTED]> wrote:
>
>Due to constraints in the API I must write a list of strings that will
>populate a List control in the form this~is~the~string~for~values\0, instead
>of this\0is\0the\0string\0for\0values\0.
>
>My question is, how can I translate the ~-delimited string on the client
>into the \0-delimited string? I've tried the following code:
>
> for (n = 0; n < StrLen(recP->Labels); n++)
> {
> cTemp = recP->Labels[n];
> if (cTemp == '~')
> StrCat(sTemp, "\0");
> else
> StrCat(sTemp, &cTemp);
> }
>
>but this doens't actually concatenate the \0, it just skips over it. Any
>help would be greatly appreciated!
Actually, your StrCat() concatenates your \0, but the next StrCat()
overwrites it, just because it's its default behavior.
StrCat() starts concatenating from the first \0 found.
A workaround would be something like
COPY your recP->Labels into a buffer
for(int i=0;i<StrLen(YourBuffer;i++)
if(YourBuffer[i]=='~')
YourBuffer[i]='\0';
HTH
Rodrigo M. Cabrera
Administrador de Proyectos
mailto:[EMAIL PROTECTED]
EMSER <http://www.emser.net>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/