well I tried to incorporate your ideas intot he snippet
but it still crashes with the same error

Char letter[256];
        Char *p;
        Char **strArray = NULL; //empty array
        Char* strLines = NULL;
        Err err;
        UInt16 recordindex = 0;
        
        StrCopy( letter, "A" );
        err = Open(); // routine to open database
    pForm = FrmGetActiveForm(); // get active form
        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 < 10; 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
           {
            recordindex++;
                strArray[recordindex] = MemPtrNew(StrLen(p) + 1);
        StrCopy(strArray[recordindex], p);

                //ghStringArray = SysFormPointerArrayToStrings(p, 1);
            //strArray = (Char**) MemHandleLock(ghStringArray);
           }
          MemHandleUnlock(h); // unlock each record 
         }
        LstSetListChoices(lsp1,strArray,recordindex); // clear list
    LstDrawList( lsp1 ); >> HERE is where debugger stops
        err = CloseDB(); 
        return true;
}

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to