Home › Forum › Omnis General Forum › DEBUG constants
Tagged: General Coding
-
DEBUG constants
Posted by gigi soave on October 16, 2019 at 10:34 amHi everybody
It does exist a method to know if an applicatio is running in “debug mode” as #DEBUG constant in VisualStudio?
Thank you
LuigiKlaus Schrödl replied 4 years, 6 months ago 2 Members · 3 Replies -
3 Replies
-
Hi Gigi,
#DEBUG in VS and debugging in Omnis are two different issues, that cannot be compared directly.
Major difference is, that in VS an EXE or DLL is being compiled in Debug or Release mode.
Since Omnis isn’t compiler based, there is no difference between libraries.
But, and maybe this helps, you can determine by code, if your code/library is running inside a runtime or inside the development IDE.
The function you can use for that is
sys(2)
From the documentation:
returns the Omnis program type byte:
bit 0 = full program/IDE (value 1),
bit 1 = runtime (value 2),
bit 2 = evaluation (value 4),
bit 3 = integrated (value 8),
bit 4 = Unicode (value 16). Always set.
Note that the current version of Omnis does not support the use of integrated versions.
So in the runtime, sys(2) will return 18 (bit 1 and 4 set, since I guess you’re working with Omnis 8 or 10 which are only availabe as Unicode version)
The IDE will return 17 (bit 1 and 4 set)
Hope that helps -
Thank you Klaus,
Reference to VS #DEBUG was in order to clear better my question with a well known example, of course, the two ide cannot be compare directly.
Your answer is exactly what I looking for.
Luigi
Log in to reply.