Hy all!!!
I'm using this function the find a item in a list. When I put the last
'LstSetSelection(lptr,iItemMid);', the compiler says :
frmRCAS.c: In function `FindItemList':
frmRCAS.c:336: `iItemMid' undeclared (first use in this function)
frmRCAS.c:336: (Each undeclared identifier is reported only once
frmRCAS.c:336: for each function it appears in.)
make: *** [Debug/frmRCAS.o] Error 1
Does anybody know why?
Thanks a lot again!!!
void FindItemList(Char* Texto)
{
FormPtr form = FrmGetActiveForm();
ListPtr lptr = (ListPtr)FrmGetObjectPtr(form, FrmGetObjectIndex(form,
lstRCAS));
int iItem = -1;
int iItemStart = 0;
int iItemStop = LstGetNumberOfItems(lptr);
char ItemStr[30];
Int16 sgn;
while (iItemStop > iItemStart)
{
int iItemMid = (iItemStart + iItemStop) /2;
//Pega o conte�do do item na lista
Char * ItemStr = LstGetSelectionText(lptr,iItemMid);
sgn = StrNCaselessCompare(ItemStr,Texto,StrLen(Texto));
if (sgn < 0)
iItemStart = iItemMid + 1;
else
{
if (sgn == 0)
iItem = iItemMid; //Remember...
iItemStop = iItemMid;
}
}
if (iItem >= 0)
//scroll to item
LstSetSelection(lptr,iItemMid);
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/