View Single Post
Old 11-11-2009, 12:38 PM   #113
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Post

Quote:
Originally Posted by ericshliao View Post
another question:
how do I get the size of buf?
I am trying using the length operator #.
The # operator or string.len() probably both do what you want. Beware that these do not stop on '\0'...

Code:
> a='xxx\0yyy'
> print(a)
xxx
> print(#a)
7
> print(string.len(a))
7
hansel is offline   Reply With Quote