My device is 2636B, with TSB, lua programming can be operated, but I need to realize the data obtained from the test (in the buffer) written to a file to facilitate the subsequent call, repeated errors, I have tried to change the permissions, change the absolute path of the file and other operations, I wrote a simple code here in the lua compiler SciTE can be run normally, but not in the TSB! I have written a simple code here, it works fine in lua compiler SciTE, but not in TSB, what could be the reason for this, I desperately want to solve this problem,
I look forward to an early reply, thank you very much!
Here is my code
local file = io.open("numbers.txt", "w")
if file then
local success, error_message = file:write("123\n456\n789\n")
if success then
print("Numbers have been successfully written to the file.")
else
print("Error writing to file: " .. error_message)
end
io.close(file)
else
print("Error opening file")
end