I am writing an app that uses IDE communicator to automate some stuff and it would be helpful if it could tell what the project type (desktop, web, etc) is. I see the CurrentBuildTargetIs* commands, but that is restricted to build steps, right?
I suppose I could check a project for a Session object since that would be web-only, and I would think there is something similar for an iOS or Android project.
If you prefix with # then the code is not included outside of the debugger. But if you don’t use the # command, you can do whatever you want ie
#If TargetMacOS Then
'only runs in macOS
MessageBox "Mac only"
#EndIf
If TargetMacOS Or TargetWindows Then
'runs in macOS or Windows
MessageBox "Mac and Windows only"
#If TargetMacOS Then
'do something for macOS only
#ElseIf TargetWindows Then
'do something for Windows only
#EndIf
End If
That’s still not quite what I am asking, so maybe a little more context will help.
The app I am writing uses the IDE communicator to add a listbox subclass directly to the IDE. That subclass has different events, methods, etc depending on if it’s a desktop listbox or a web listbox. Right now, the app just has a popup menu to select if it’s a desktop or a web listbox, but I would like it if the app can query the active project via the communicator to get the project type automatically.
I’ll play around with this approach to see if there is another way to get there, but I am starting to think that I’ll just need to check for the presence of a “Session” object as my flag.