A way to detect exported state at runtime?

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
mahan
Posts: 19
Joined: Sun Nov 15, 2015 9:44 pm

A way to detect exported state at runtime?

Post 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.
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: A way to detect exported state at runtime?

Post by Fred »

You can probably use the #PB_Compiler_Debugger directive to put your debug code between 'CompilerIf : CompilerEndIf'
mahan
Posts: 19
Joined: Sun Nov 15, 2015 9:44 pm

Re: A way to detect exported state at runtime?

Post by mahan »

Thanks Fred, that works perfectly for my use case. :)
Post Reply