We wrote an application originally designed to run in a Linux environment. For years this app has worked without crashing. We recently changed our target to Windows 8 development. Compiled the App as an exe, booted it up on the device, and had mixed results.
Often it will freeze or crash randomly, for seemingly no reason. Most of the interface seems to work up until the program randomly dies out.
Should we update our Real Studio or would that not be a possible cause for this issue?
use a timer to do the work in ‘small chunks’ (e.g. if you have 6 million things to do, use a timer that fires now and then, and does 1000 things, records how far it got, then ends until triggered again.
(frowned upon but sometimes…) Add an app.doevents inside the loop.
Now if you have a loop of 1 million things, you don’t want to call app.doevents 1 million times.
if its a for x = , for y = sort of thing, you only put the app.doevents in the outer loop
And you can make sure it only gets called now and then using MOD
eg for x = 1 to 1000000
if x mod 2000 = 0 then app.doevents
Consider creating a small helper app to do the work. e.g. write some data to disc, launch a console app to process it and write the result to disc then die. Pick up the results when they are available using the main app.
I think Im having a similar problem. I have a windows 10 PC and I just installed Xojo 2015 r3.1 and tried to run an older file from real studio in it and after I press run it compiles the windows and then freezes. I only have a few buttons on the application, nothing fancy. Any idea what’s wrong?
If Xojo compiles fine it means the code is alright. The freeze signals some runtime execution problem. Applications freezing can happen with input-output. Here, I had an app that freezed when I tried to access a network printer that was inaccessible. If your app does any synchronous shell operations or HTTPSocket it can also freeze the UI.
Finally, any tight loop like while/wend or do/Until without timeout can be the culprit. I never use them without something like :
dim startvalue as double = ticks
While not this and ticks < startvalue + 10
That way if this never turns true the loop will exit after 1/6th of a second.
I would tend to look at every declare in there that could explain the issue at run time.
Another possible explanation could be a corrupted binary project. That happens and can have strange effects. If you still have RS or if you have a current Xojo license, try loading the project and saving it as XML, then load the XML and see if the issue is still present.