RE: text to number 2

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 31 Jan 2002, at 6:04, dmccu at connect.ab.ca wrote:

> 
> Irv,
> 
> What is strtok.s?  

"s" ? It's ".e".

It's an include that treats "words" or words in a sentence, sequence, data 
line, etc as entities, separated by things like spaces, commas, semicolons, 
or whatever you specify. The strtok functions let you do things to words in 
sentences like you would characters in strings, like reptok(), deltok(), 
gettok(), etc etc.. 

So for 
line = {"Smith","Alice",1234,2002,"xyz45abc"} 
field1 = gettok(line,1,44) -- 44 is ascii for comma
field1 = "Smith"
count = numtok(line,44) -- count = 4

so you can pick out words or data fields or tags easily.

http://www.rapideuphoria.com/strtok.zip

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu