PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Differentiating a code run in an component from a code run in a project (WINDEV or WEBDEV)
  • Test mode of a component
  • Note
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This function is now available for the Windows Phone applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
WINDEVReports and QueriesWindows MobileUser 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).

Test mode of a component

When running the test of a component, the component is considered as being a stand-alone application. InTestMode returns True.

Note

InComponentMode is available for all the products to allow for a multi-product code. Functions or procedures that use InComponentMode can be shared between several products without generating any compilation error.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment