how reset token of strtok ?

Windows specific forum
User avatar
bingo
Enthusiast
Enthusiast
Posts: 210
Joined: Fri Apr 02, 2004 12:21 pm
Location: germany/thueringen
Contact:

how reset token of strtok ?

Post 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:
["1:0>1"]
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

the stringbuffer is altered by strtok. Simply set it to a new value or use temporary buffer instead :wink:
Post Reply