How can I tell whether my RealBasic code is running inside a Console or desktop application?
Asked
Active
Viewed 158 times
1 Answers
2
You can use this conditional sentence:
#if TargetHasGUI then
' It's running in a desktop app
#else
' It's running in a console app
#endif

Paul Lefebvre
- 6,253
- 3
- 28
- 36

Cesco
- 3,770
- 7
- 24
- 26
-
Be aware that Web Apps return True for `TargetHasGUI` as well. – Andrew Lambert Aug 21 '12 at 16:39
-
Correction: Web Apps return False – Andrew Lambert Aug 21 '12 at 18:58