@megacube, thank you for the details.
> Here is the program and output without debugger using RUN mode:
That’s correct; you’d see no output in the RUN mode.
> …and here is the output using the debugger line in RUN mode:
Debugging session started in ‘C:\Users\Mark\Desktop’.
“Test String…”
“Test String…”
Debugging session completed (traced 0 instructions).
Debugging session started in ‘C:\Users\Mark\Desktop’.
“Test String…”
“Test String…”
This is correct too. What happens here is that you have two "print"s in your script that each print the same string “Test String…”. The reason why this thing is executed twice is more subtle. This is something I described under “Debugger Functions” here and am copying here for convenience: “The Corona SDK engine seems to include a check that automatically restarts your application when it detects that the application is “stalled”. This is exactly what happens when the application is being debugged as it passes the control back to the IDE (even though for a short time), so it may look like the application is started twice (if you put a breakpoint in your main script). To avoid this effect, you can start debugging inside enterFrame event handler, which I’m going to demonstrate in the next section.”
The description here is inferred based on the behavior I see and discussions in forums on this issue. This seems to be mostly harmless as it only executes the “main” body twice when debugging; you can avoid this by moving debugging code to one of the handlers, for example, onUpdate:
function onUpdate(event)
– let the first call to onUpdate to return quickly;
– start the debugging during the second call to trick Corona SDK
– and avoid restarting the app.
if done == nil then done = false return end
if not done then
require(“mobdebug”).start()
done = true
end
…
If someone knows a better way to avoid this, I’m listening…
> …and here is the output using DEBUG mode with the same sample code above:
> Program starting as ‘“C:/Program Files (x86)/Corona Labs/Corona SDK/Corona Simulator.exe” -debug 1 -project “C:\Users\Mark\Desktop\main.lua”’.
> Program ‘Corona Simulator.exe’ started in ‘C:\Users\Mark\Desktop’ (pid: 6152).
> …and the following error message from the Corona Simulator:
> c:\Users\Mark\Desktop\1 was not found.
This is very strange as this code should not be executed if you are using 0.361. This is a parameter for the OSX version, not Windows. Can you check if your interpreters/corona.lua has the right content, esp. this line? Thank you.
Paul.