As the title says... Chat on...

User avatar
By ccxx
#10615 Can someone explain why if i insert this line :

Code: Select all file.writeline('wifi.sta.config("'..myssid..'","'..mypassword..'")')

inside my code i receive a tons of strange character and the procedure doesn't work at all ?
If i exclude this line or if i replace variables with text everything works fine.
User avatar
By picstart
#10617 The fact to be aware of is that lua is by default an interpreter not a compiler though lua code can be compiled.
Code is text and text is text the difference is with code the interpreter will find keywords in the text( lua syntax)
The interpreter needs to know not to delve into the code you want to be stored in a lua file. This is where [[ ]] comes in.
You only want the interpreter to interpret file.writeline and go no further than to write the line.
This is where [[ ]] comes in since it asks the interpreter to go no deeper.