Files
harbour-core/harbour/tests/working/testtok.prg
1999-06-04 11:49:42 +00:00

26 lines
440 B
Plaintext

#include "set.ch"
procedure main()
local a
local i
set( _SET_EXACT, .T. )
a := strtoarray("this is a great big test of strtoken")
for i := 1 to len(a)
qout( a[i] )
next i
return
function strtoarray(s)
local aResult := {}
local t, l
while( s <> "" )
t := strtoken(s, 1,, @l)
aadd(aResult, t)
s := substr(s, l + 2) // skip the delimiter
qout( t, str(l), s )
end
return aResult