LoadString bug
Monkey Forums/Monkey Programming/LoadString bug
| ||
This one has been driving me crazy. If you make something as simple as this: [monkeycode]Import mojo Function Main() New MyGame(LoadString("level1.txt")) End Class MyGame Extends App Method New(level:String) 'Do stuff... End End[/monkeycode] You'll see LoadString failing. If the LoadString is executed after the App class is created (instead of before as a parameter in this case) it works as always. It's very weird. It fails in glfw, xna and html5. |
| ||
It's not weird, when the App class is created, it creates the device interface. LoadString() is just a quick method that returns Device->LoadString() I think the most that would happen with this bug is a check to see if the device is NULL or not. Maybe in Debug Mode the function can throw an Error? |
| ||
well, in this case, it is not documented. |
| ||
Hi, From the mojo module docs... Mojo functions should not be called until your application's OnCreate method is called. |
| ||
Aaaah I see, I think it was part of the os module.. sorry |
| ||
Yeah, the OS module has it's own LoadString that doesn't use a device. Maybe you were confusing the two. |