Download PICASO Internal 4DGL Functions
Transcript
PICASO INTERNAL 4DGL FUNCTIONS 4D SYSTEMS PICASO INTERNAL 4DGL FUNCTIONS 2.16.13. str_FindI(&ptr, *str) Syntax str_FindI(&ptr, *str); Arguments ptr, str Returns ptr Byte pointer to string buffer. str String to find. Value Value Returns 0 if not found. Returns the position of the find if successful. Description Case Insensitive. Searches for string str in string buffer pointed to by ptr. NB:- The pointer ptr is not altered. Example var var var var buffer[100]; p; n; strings[4]; // 200 character buffer for a source string // string pointer // for our test strings func main() txt_Set ( FONT_ID, FONT2 ); strings[0] := "useful" ; strings[1] := "string" ; strings[2] := "way" ; strings[3] := "class" ; to(buffer); print ( "and by the way, the string class useful " ); p := str_Ptr(buffer); string functions p := p + 13; "way" is rather // raise a string pointer so we can use the // offset into the buffer a little so we don't see word print( "p=" , p , "\n\n" ); // show the start point of our search n := 0; while ( n < 4 ) print( "\"" , [STR] strings[n] , "\" is at pos " , str_Find ( &p , strings[n++] ) , "\n" ); wend print ( "\nNOTE: p is unchanged, p=" , p );//note that p is unchanged endfunc © 2012 4D SYSTEMS Page 261 of 317 www.4dsystems.com.au