Page 1 of 1

how reset token of strtok ?

Posted: Tue Apr 29, 2008 4:13 pm
by bingo

Code: Select all

ImportC "msvcrt.lib" 
strtok(string.l,deli.l)
EndImport

;or:
;ImportC "crtdll.lib" 
;strtok(string.l,deli.l)
;EndImport

list.s = "test1,test2,test3"

part.l = strtok(@list,@",")

While part
Debug PeekS(part)
part = strtok(#Null,@",") 
Wend

; how reset token of strtok ????

part = strtok(@list,@",")

While part
Debug PeekS(part)
part = strtok(#Null,@",") 
Wend
reset the strtok-token - it is possible ? :roll:

Posted: Tue Apr 29, 2008 6:19 pm
by ABBKlaus
the stringbuffer is altered by strtok. Simply set it to a new value or use temporary buffer instead :wink: