Page 1 of 1

A way to detect exported state at runtime?

Posted: Tue Mar 29, 2016 8:27 pm
by mahan
This is a combined question and request:

Is there a way to detect at runtime that the running application has been exported? (Menu->Compiler->Export)

I'm thinking about things like debug code or for instance special development functions like auto-login when running the application from the IDE, but which should never be "shipped" or "deployed" to production?

If it's not possible today, I'd like to suggest for instance a #PB_Exported constant that is equal to #True when the application has been exported but #False otherwise.

Just a though.

Re: A way to detect exported state at runtime?

Posted: Wed Mar 30, 2016 9:28 am
by Fred
You can probably use the #PB_Compiler_Debugger directive to put your debug code between 'CompilerIf : CompilerEndIf'

Re: A way to detect exported state at runtime?

Posted: Wed Mar 30, 2016 7:19 pm
by mahan
Thanks Fred, that works perfectly for my use case. :)