PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • parameter
  • Limitations
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Compilation statement: IF ExecutionTarget
In french: SI CibleExécution
The <IF ExecutionTarget> compile statement allows you to compile or not compile a WLanguage code depending on the execution target.
This statement is mainly used to easily get a multi-configuration code, without displaying any compilation errors.
Remark: In general, <COMPILE IF> compilation conditions should be used as much as possible to manage the differences between different platforms. However, when any of the configurations that use the code needs to adapt to multiple execution targets, it is necessary to use <IF ExecutionTarget>.
Example
<IF ExecutionTarget=WindowsApplication OR ExecutionTarget=Java>
Open(WIN_Menu)
<END>
<IF ExecutionTarget=Android OR ExecutionTarget=iOS>
OpenMobileWindow(WIN_Menu)
<END>
<IF ExecutionTarget=Site>
PageDisplay(PAGE_Login)
<END>
Syntax

Single execution target

<IF <ExecutionTarget=<Target name>>
... // Code if the condition is true
<END>

Combination of conditions

<IF <ExecutionTarget=<Target name> OR <ExecutionTarget=<Target name2>>
... // Code if the condition is true
<END>

Using the <> operator

<IF <ExecutionTarget <> <Target name>>
... // Code if the condition is true
<END>

Using an ELSE block

<IF <ExecutionTarget <> <Target name>>
... // Code if the condition is true
<ELSE>
... // Code if the condition is false
<END>
Remarks

<Target name> parameter

The different targets are as follows:
  • Android
  • AppleWatch
  • DotNetApplication
  • LinuxApplication
  • WindowsApplication
  • DotNetAssembly
  • Library
  • ExternalComponent
  • iOS
  • iOSWidget
  • Java
  • Linux
  • MacCatalyst
  • RADPattern
  • ActionPlan
  • WebSocketServer
  • WebSocketServerLinux
  • WebSocketServerWindows
  • LinuxService
  • WindowsService
  • Site
  • SiteLinux
  • PHPSite
  • SiteWindows
  • UniversalWindowsApp
  • Webservice
  • WebserviceLinux
  • WebserviceWindows
  • Windows
Limitations
  • You cannot declare global variables in an <IF ExecutionTarget> statement.
  • Local variables must have unique names for all execution targets.
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment