re: Error In TextMgr

2004-09-01 Thread Ken Krugler
thanks, but I not pass 0,
Actually you are passing in 0...see below.
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'};
As Matt noted in his response, this isn't necessary.
 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) );
Since you've set theSearch[0] to 0, StrLen(theSearch) is going to return 0.
I believe you want:
TxtGluePrepFindString(SearchString, theSearch, sizeof(theSearch));
-- Ken
--
Ken Krugler
TransPac Software, Inc.

+1 530-470-9200
--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Error in TextMgr

2004-08-31 Thread Ken Krugler
I want to find one substring  in other, i use TxtFindString, but 
before i use TxtGluePrepFindString to set the
search, the 2 string are same
Not sure what this means.
but inSource not are the same address as inSource.
Same comment as above.
When i run with the emulator say this:
Filtra (1.0) called SysFatalAlert with the message:
"TextMgr.c, Line:945, Dest buffer too small".
Any idea?
First, whenever you post an error message generated by the OS, it's 
very useful to include the OS version number, the device's locale 
(language), and whether you're encountering this with a real device 
(if so, which one) or POSE/PalmSim.

Second, as Gavin noted in his response you'll get this error from 
Txt[Glue]PrepFindString if the last parameter (iDstSize) is zero.

One clarification to what Gavin said - the iDstSize parameter is 
actually the size of your destination buffer, not the length of the 
destination string. In other words, the value you pass in should 
include space for the byte at the end of the destination buffer 
string.

-- Ken
--
Ken Krugler
TransPac Software, Inc.

+1 530-470-9200
--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Error in TextMgr

2004-08-31 Thread Matt Graham
rguevara wrote:
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) );
I think it means what's passed back to theSearch will be the same, not 
what you have to pass in.

does this work?
TxtGluePrepFindString( SearchString, theSearch, sizeof(theSearch)-1 );
if not, try setting theSearch to be bigger.  And I don't think you need 
to manually initialize every element in the array.

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


re: Error in TextMgr

2004-08-31 Thread rguevara
Sorry, but in the last mail forget comment a line:

//Function search string in description of DB (internal,  not GlobalFind ) 
FilterStock(char * SearchString)
{
...
// FrmCustomAlert(Message, "Comparing 0", theProduct, SearchString); // differ, ok?
...
}


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


re: Error in TextMgr

2004-08-31 Thread rguevara
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;  idesc, 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 -
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/


re: Error in TextMgr

2004-08-30 Thread Gavin Maxwell
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/


Error in TextMgr

2004-08-30 Thread rguevara
Hello

I want to find one substring  in other, i use TxtFindString, but before i use 
TxtGluePrepFindString to set the 
search, the 2 string are same but  inSource not are the same address as inSource.
When i run with the emulator say this:

Filtra (1.0) called SysFatalAlert with the message:
"TextMgr.c, Line:945, Dest buffer too small".

Any idea?

Thanks
--
Open WebMail Project (http://openwebmail.org)


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