Just starting out? Need help? Post your questions and find answers here.
Jarlve
 
Posts: 19
Joined: Mon Jun 18, 2018 6:10 pm

CompilerIf

by Jarlve Tue Jun 26, 2018 7:17 am

This code is in my program and does not seem to be needed to make it work. Is it needed in some cases? What does it do?
Code: Select all
CompilerIf #PB_Compiler_OS<>#PB_OS_Web
Repeat
Event=WaitWindowEvent()
Until Event=#PB_Event_CloseWindow
CompilerEndIf
User avatar
Peter
 
Posts: 493
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: CompilerIf

by Peter Tue Jun 26, 2018 9:13 am

With this compiler query you can test under which operating system your code runs. In your example, the event loop will only be included in the compilation if you do not run the code in the web browser.

So you can (theoretically) run your code without big changes under Windows, Linux, MacOS with PureBasic and in the web browser with SpiderBasic. If you only want to program for the web, you can remove the compiler query.

Greetings ... Peter
Jarlve
 
Posts: 19
Joined: Mon Jun 18, 2018 6:10 pm

Re: CompilerIf

by Jarlve Tue Jun 26, 2018 11:01 am

Thanks Peter.
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 4 guests