thanks, but I not pass 0, the code is:
//Function search string in description of DB (internal, not GlobalFind )
FilterStock(char * SearchString)
{
char
theSearcht[16]={'\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0'};
int i=0, j=0;
UInt32 posP;
UInt16 length;
Int16 tam;
MemHandle myRecord;
Boolean match=false;
ListType *pList = (ListType*) GetObjectPtr(ConsulStockList);
tam=DmNumRecordsInCategory(ProductosDB,dmAllCategories);
tamliststkfil=0;
StrCopy(theSearch, SearchString); //In the api doc say "The same text as in inSource
...", its ok?
TxtGluePrepFindString ( SearchString, theSearch, StrLen(theSearch) );
FrmCustomAlert(Message, "Comparing 0", theProduct, SearchString); // differ, ok?
for(i=0; i<tam ; i++)
{
DmQueryRecord(ProductosDB, i);
myRecord = DmQueryRecord(ProductosDB, i);
if (myRecord)
{
ProductoPacked * prec = (ProductoPacked *) MemHandleLock(myRecord);
ProductoReg * rec = (ProductoReg *) MemPtrNew(sizeof(ProductoReg));
UnpackProducto(rec, prec);
if (myRecord)
{
//Here the rec->desc, its ok, but TxtFindString always return
false
match = TxtFindString ( rec->desc , theSearch, &posP, &length
) ;
// match = FindStrInStr ( rec->desc , theSearch, &length ) ;
// match = TxtGlueFindString (theSearch , theSearch, &posP,
&length ) ;
if(match)
{
StockFiltra[ j ].codigo=(unsigned int)
StrAToI(rec->codigo);
StockFiltra[ j ].posindb = i;
j++;
tamliststkfil++;
}
}
MemHandleUnlock(myRecord);
MemPtrFree(rec);
}
}
if(theSearch !=NULL)
MemPtrFree(theSearch);
if (NULL == pList) return 1;
LstSetDrawFunction( pList, DrawFiltraStockItem);
LstSetListChoices(pList, NULL, tamliststkfil);
LstSetSelection(pList, 0);
LstDrawList(pList);
}
I add the GLUE library and compile right, but i can't search the substring in other,
exist other function what
search without depend of Localization or Normalization
It would thank for some aid
--
Open WebMail Project (http://openwebmail.org)
---------- Original Message -----------
From: "Gavin Maxwell" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Tue, 31 Aug 2004 05:11:14 -0000
Subject: re: Error in TextMgr
> I believe you'll get that error if you pass 0 for the last parameter... it
> should specify the length of your outDest string.
>
> G.
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/support/forums/
------- End of Original Message -------
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/