Thanks to all who helped in many various ways
I used a little of mine and a lot of yours to get this to work
Thanks again
Char letter[256];
Char *p;
Char **strArray = NULL; //empty array
Char* strLines = NULL;
Err err;
UInt16 recordindex = 0;
pForm = FrmGetActiveForm(); // get active form
StrCopy( letter, "A" );
err = Open(); // routine to open database
lsp1 = FrmGetObjectPtr(pForm, FrmGetObjectIndex(pForm, frmList1)); // get id of
list control
nRecordIndex = DmNumRecords(dbPtr); // number of records
strArray = MemPtrNew(nRecordIndex * sizeof(Char *));
for(index =0; index < nRecordIndex; index++) // lets index through database
{
h = DmQueryRecord(dbPtr, index); // lets query each record
p = (Char *) MemHandleLock(h); // lets lock each record
if( 0 == StrNCaselessCompare( letter, p, 1) ) //compare first letter of first
field
{
strArray[recordindex] = MemPtrNew(StrLen(p) + 1);
StrCopy(strArray[recordindex], p);
recordindex++;
}
MemHandleUnlock(h); // unlock each record
}
LstSetListChoices(lsp1,strArray,recordindex); // clear list
LstDrawList( lsp1 );
err = CloseDB();
return true;
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/