249 posts
Location
In the universe
Posted 09 October 2012 - 06:30 PM
I have two questions:
1.How can I turn a letter into a number?
2. How can I count the number of files listed by fs.list()?
Thanks
2217 posts
Location
3232235883
Posted 09 October 2012 - 06:42 PM
what do you mean turn a letter into a number?
if you want to get the ascii value of it you can use string.byte(char)
if you want to turn a string like "3123" into a number you can do number operations with you can use tonumber(string)
fs.list returns a table, you can check the size of that table by putting a # infront it
files=fs.list()
number_of_files=#files -- or just use #files in the expression you use it
249 posts
Location
In the universe
Posted 09 October 2012 - 09:01 PM
the problem with that is that I tried it, but it was the same result if for example "hello" and "obis"