ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Miscellaneous WINDEV functions
  • Differentiating a code run in an component from a code run in a project (WINDEV or WEBDEV)
  • Component test mode
  • Availability of the function
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
Indicates whether the code is run:
  • from a WINDEV application, a WEBDEV site or a PHP page.
  • from a component.
In a project used both to create an executable or a site and to create a component, this function is used to run a different code according to the runtime mode of the project. This function is useful to differentiate the initialization code of the project used by the application from the one used by the component.
AndroidAndroid Widget Java This function has no effect in this version.
Example
WINDEVReports and QueriesUser code (UMC)
// Code run from the component?
IF InComponentMode() = True THEN
Info("You are running the created component " + ...
  "in the MyProject application")
ELSE
Info("You are running the MyProject application")
END
WEBDEV - Server codePHPAjax
// Code run from the component?
IF InComponentMode() = True THEN
Info("You are running the created component " + ...
 "in the MySite site")
ELSE
Info("You're running the MySite site")
END
Syntax
<Result> = InComponentMode()
<Result>: Boolean
  • True if the code is run from a component,
  • False if the code is run from a WINDEV application, a WEBDEV site or a PHP page.
AndroidAndroid Widget Java This parameter always corresponds to False.
Remarks

Differentiating a code run in an component from a code run in a project (WINDEV or WEBDEV)

In a project used both to create an executable or a site and to create a component, this function is used to run a different code according to the runtime mode of the project.
This function allows you to run a distinct code:
  • in the initialization code of the project. Indeed, this code is common to the application (executable) and to the component (WDK file) created from the same project.
  • in a class, a set of procedures, a window, ... shared between a project used to create a WINDEV application (executable) and a project used to create a component (WDK file).

Component test mode

When testing a component, it is considered as a stand-alone application. InTestMode returns True.

Availability of the function

InComponentMode can be used in all IDEs to allow for cross-platform code. Functions or procedures that use InComponentMode can be shared between several products without generating any compilation error.
Business / UI classification: Neutral code
Component: wd290vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/24/2022

Send a report | Local help