App runs differently compiled

Hello,
I’ve had a project code base for a few years. I periodically make copies for new versions etc.
Everything runs fine in the IDE. But all of a sudden when I compile, the app does not run the calculations.
There is no error reported. Nothing seems to be going wrong. But it does not recalculate and draw the
graphs like it is supposed to. Usually if something is off in the compiled version it will crash and report
an error. I have code to catch various errors.

At a loss as to why this is happening or how to debug since it works fine in the IDE.

Thanks in advance for any suggestions.
-Tim

Oops meant to mention the same thing happens on Mac and on Windows. Works in IDE fine on both platforms but does nothing when compiled on both. Compiling on Mac for Mac and on Windows for Windows. Also tried compiling on Mac targeting Windows. All give same result.

by any chance, do you have #If debugbuild statements somewhere? You could be enclosing more logic than you anticipated, such that the compiled app will not run as expected.

or places where you attempt to draw to a canvas outside of its paint event?
or attempt to update the UI from inside a thread?
or #IF TARGET where target is NOT the correct one?

Or code is jumping out into ‘unhandled exception’ at the very start of your calc routine.
Do you have any logging in there to spot that?

I have looked for that just now and didnt find any that were not quickly closed a few lines later.

[quote=385747:@Dave S]or places where you attempt to draw to a canvas outside of its paint event?
or attempt to update the UI from inside a thread?
or #IF TARGET where target is NOT the correct one?[/quote]

I don’t think it is any of these as I have not made any changes that involve any of those. I will double check though.

[quote=385751:@Jeff Tullin]Or code is jumping out into ‘unhandled exception’ at the very start of your calc routine.
Do you have any logging in there to spot that?[/quote]

Yes I have logging. I rebuilt the app and ran it on the Mac and just got a KeyNotFound Exception. So right now looking into that. Can’t tell where in my code that is happening though. Does not happen in the IDE which is weird.

I think I’m going to do a project comparison with an earlier project file and see if any accidental changes were made and also just scrutinize every change made.

Does your app access Folderitems to do its work, and if so does your code accessing the files exit silently without logging an error after a check for Nil and Exists? In other words, check that you have you put any needed files in the right place for the compiled app, and check that errors on file access are not silently ignored in your code.

I figured out the problem today. And the issues was indeed related to #if DebugBuild. Merci beaucoup Louis Desjardins!

I have this little grid of data in my app. For debugging I sometimes just add another column and wrap it with
#if DebugBuild so that end users don’t see all the debug cols I have added.

The problem was the data I added in there to debug was not also wrapped in the #if DebugBuild code.
So… when it was compiled the algorithm was trying to add data to a column that did not exist which was causing a KeyNotFound Exception. But when running in the IDE all appeared fine because the column did exist when running the code in the IDE.

One odd thing is that sometimes when it would run it would pop up the exception catch code screen to show the stack but other times the app would just freeze and not calculate anything, but not report any error.

Well anyway it’s fixed now. Thanks for all of the great ideas and suggestions on things to look for!

I am glad I could help.