I think you've got two choices: 1) reserve memory for your array and copy the entry from the database to your reserved memory, 2) go the owner-draw route and query each record as you draw it. If you have duplicates or skips, store an array of indexes.
-- ------------------------------------------------------------------------- Free software - Baxter Codeworks www.baxcode.com ------------------------------------------------------------------------- "Chris Engler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All, > > I have read through all the listings I can find on populating a list from a > database and am still having problems with a NULL string passed. Below is a > sample of my code. It works fine untill the data base is present, then it > has problems. I have a four column database with a couple hundered entries > and several in the first column are repeated so, I do a check so I don't > load the same choice into the array several times. I would really > appreciate it if someone could aim me in the correct direction. Any help is > appreciated! > > Best Regards, > Chris Engler > > Char * gList[31]; > > gList[indexLst] = "None"; > indexLst++; > if(gDB) > numRecords = DmNumRecords(gDB); > if(numRecords) > { > MemHandle recordH = 0; > Char * record = NULL; > Char * text = NULL; > > for (indexDB = 0; indexDB<numRecords; indexDB++) > { > recordH = DmQueryRecord(gDB, indexDB); > if (recordH) > { > record = MemHandleLock(recordH); > if (!StrCompare(record,gList [indexLst-1])) > { > gList [indexLst]= record; > indexLst++; > } > MemHandleUnlock(recordH); > } > } > } > list = (ListType *)GetObjectPtr(TypeList); > numRecords = sizeof(gList); > LstSetListChoices(list, gList, numRecords); > > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
