I have to this sort of thing in a bunch of places in my code.  I usually use
StrStr to break the string up into its parts and then LstSetListChoices to
populate the list.

Char **cMailItems;

 giNumMail=0;

 /*loop through all records*/
 for(i=0; i < MAX_MAIL; i++){
  h=DmQueryRecord(gMailDB,i);
  if(h){
   cItem=MemHandleLock(h);

   if( StrCompare( cItem, "NA" ) != 0 )


    /*allocate space for 1 array element with the current item*/
   /*SBuf2 is a preallocated char pointer that we use for all of our
storage*/
    cMailItems[i]= SBuf2 + 8000 + (i* (StrLen(cItem) + 50));
    /*copy the current item to the array*/
    StrCopy(cMailItems[i],cItem);
    giNumMail++;
   }
   MemHandleUnlock(h);
  }
 }

 if(giNumMail>0)
  /*pass the list array to the list*/
  LstSetListChoices(lstMail,cMailItems,giNumMail);

"prasad" <[EMAIL PROTECTED]> wrote in message
news:76605@palm-dev-forum...
>
> Hi,Friends
>           iam facing the problem on strings.
>
> first i saved the string in a Database like "string1,string2,string3" as a
one record
> now i want to retrieve these record and separate these strings  then after
that i want
> set to list items like
>   str1
>   str2
>   str3
> if any one have idea to set list itmes.please tell me.
>
> thanks.
>
>
>
> -------
>
>
> _____________________________________________________________
> Get Your Free ScanMail and Email At http://www.bharatmail.com
>
>



-- 
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