lua function return problem.
I hope I post this thread in a right place. The code below, lua complains I didn't end the function with 'end' in line 5, but if I remove line 5 'return "trash"', it works fine.
Thanks in advance!
1 #!/bin/env lua
2
3
4 function abc(strin)
5 return "trash"
6
7 if strin == "hello"
8 then
9 print("hello");
10 return "hello";
11 else
12 print("abc");
13 return "abc";
14 end
15 end
16
17 abc("hello");
|