在纯文本文件中直接输入Lua语句,然后保存。可以没有后缀名,但是推荐用“.lua”作为后缀名。例如文件名为:myFile.lua。文件内容为:
>>print("You are ruthless. You are cruel. You are unreasonable.")
>print("Aren't you heartless! ? Aren't you cruel! ? Aren't you unreasonable! ?")
>print("I'm not ruthless. I'm not cruel. I'm not unreasonable.")
>
被拆开的几行,第一行保持原有的缩进,后几行一般在第一行的基础上缩进一层,以方便读写。例如一个参数比较多的函数调用:
>>print(123,
> 'hello world and this is my...',
> 'there is another ...',
> 2722.3272,
> 2234)
>