PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Other possibilities
  • GO from Reports & Queries
  • 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
InTestMode (Function)
In French: EnModeTest
Warning
From version 16, OntestMode is kept for backward compatibility. This function is replaced by InTestMode.
Indicates whether the application or the site is started:
  • from the WINDEV or WEBDEV editor,
  • from the executable or browser.
  • WEBDEV - Server code from the WEBDEV administrator.
AndroidAndroid Widget JavaPHP 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
IF InTestMode() = True THEN
Trace("MenuNum variable: " + MenuNum)
END
Syntax

Checking the start mode of application Hide the details

<Result> = InTestMode()
<Result>: Boolean
  • True if the application is run:
    • from the WINDEV editor (window or project Go).
    • from the editor of Reports and Queries (report Go).
    • in debug on Mobile.
    • in component debug via executable.
    • from the WEBDEV editor (page or project Go).
    • WEBDEV - Server code from the WEBDEV administrator (Test button).
  • False otherwise.
Special cases:
  • WEBDEV - Server code In AWP mode, this parameter always corresponds to False.
  • Versions 22 and later
    WINDEVWEBDEV - Server code In a REST Webservice, this parameter always corresponds to False.
    New in version 22
    WINDEVWEBDEV - Server code In a REST Webservice, this parameter always corresponds to False.
    WINDEVWEBDEV - Server code In a REST Webservice, this parameter always corresponds to False.
  • AndroidAndroid Widget JavaPHP This parameter always corresponds to False.
Versions 16 and later

Checking the origin of start mode of application test Hide the details

<Result> = InTestMode([<Type of Execution>])
<Result>: Boolean
  • True if the test is run from the requested element,
  • False otherwise.
Note: The start mode taken into account is the one for the origin of test. For example, if the test of the report is run from a window displayed by a project GO, the origin of test will be the project GO.
<Type of Execution>: Integer constant (or combination of constants)
Origin of test execution:
Versions 16 and later
tmReport
New in version 16
tmReport
tmReport
Test run from a report Go.
Versions 16 and later
tmWindow
New in version 16
tmWindow
tmWindow
Test run from a window Go.
Versions 16 and later
tmPage
New in version 16
tmPage
tmPage
Test run from a page Go.
Versions 16 and later
tmProcedure
New in version 16
tmProcedure
tmProcedure
Test run from a procedure Go.
Versions 16 and later
tmProject
New in version 16
tmProject
tmProject
Test run from a project Go.
Versions 16 and later
tmQuery
New in version 16
tmQuery
tmQuery
Test run from a query Go.
Versions 16 and later
tmTest
New in version 16
tmTest
tmTest
Test run from the Go of an automatic test.
New in version 16

Checking the origin of start mode of application test Hide the details

<Result> = InTestMode([<Type of Execution>])
<Result>: Boolean
  • True if the test is run from the requested element,
  • False otherwise.
Note: The start mode taken into account is the one for the origin of test. For example, if the test of the report is run from a window displayed by a project GO, the origin of test will be the project GO.
<Type of Execution>: Integer constant (or combination of constants)
Origin of test execution:
Versions 16 and later
tmReport
New in version 16
tmReport
tmReport
Test run from a report Go.
Versions 16 and later
tmWindow
New in version 16
tmWindow
tmWindow
Test run from a window Go.
Versions 16 and later
tmPage
New in version 16
tmPage
tmPage
Test run from a page Go.
Versions 16 and later
tmProcedure
New in version 16
tmProcedure
tmProcedure
Test run from a procedure Go.
Versions 16 and later
tmProject
New in version 16
tmProject
tmProject
Test run from a project Go.
Versions 16 and later
tmQuery
New in version 16
tmQuery
tmQuery
Test run from a query Go.
Versions 16 and later
tmTest
New in version 16
tmTest
tmTest
Test run from the Go of an automatic test.

Checking the origin of start mode of application test Hide the details

<Result> = InTestMode([<Type of Execution>])
<Result>: Boolean
  • True if the test is run from the requested element,
  • False otherwise.
Note: The start mode taken into account is the one for the origin of test. For example, if the test of the report is run from a window displayed by a project GO, the origin of test will be the project GO.
<Type of Execution>: Integer constant (or combination of constants)
Origin of test execution:
Versions 16 and later
tmReport
New in version 16
tmReport
tmReport
Test run from a report Go.
Versions 16 and later
tmWindow
New in version 16
tmWindow
tmWindow
Test run from a window Go.
Versions 16 and later
tmPage
New in version 16
tmPage
tmPage
Test run from a page Go.
Versions 16 and later
tmProcedure
New in version 16
tmProcedure
tmProcedure
Test run from a procedure Go.
Versions 16 and later
tmProject
New in version 16
tmProject
tmProject
Test run from a project Go.
Versions 16 and later
tmQuery
New in version 16
tmQuery
tmQuery
Test run from a query Go.
Versions 16 and later
tmTest
New in version 16
tmTest
tmTest
Test run from the Go of an automatic test.
Remarks
WINDEVWEBDEV - Server codeWINDEV MobileReports and QueriesWindows Mobile

Other possibilities

  • Windows Mobile InSimulatorMode is used to differentiate between the test mode on the mobile device and on the simulator.
  • WINDEVWEBDEV - Server codeWINDEV MobileReports and Queries InReportsAndQueriesMode is used to differentiate between the test mode from the report editor and the test mode from Reports & Queries.
WINDEVReports and QueriesUser code (UMC)

GO from Reports & Queries

InTestMode and InReportsAndQueriesMode return True when the test of a report is run from "Reports and Queries" ("GO" button).
We advise you to replace the standard test:
IF InTestMode() = True THEN
Trace("...")
END
by the following test:
IF InTestMode() = True AND InReportsAndQueriesMode() = False THEN
Trace("...")
END

Note

InTestMode is available for all the products to allow for a multi-product code. Functions or procedures that use InTestMode 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
EXEMPLO InTestMode
// VAMOS SUPOR QUE EU QUERO COLOCAR UM INFO PARA MOSTRAR ALGO, MAS SOMENTE QUANDO ESTOU TESTANDO
// E NAO NO EXECUTAVEL DO CLIENTE

IF InTestMode()=True THEN
Info("EDT_Codigo_remetente_112:"+CR+EDT_Codigo_remetente_112)
END

// BLOG COM VIDEO E EXEMPLO

http://windevdesenvolvimento.blogspot.com.br/2017/10/aula-1267-comandos-018-intestmode.html

https://www.youtube.com/watch?v=zO1WE2PrkAQ
De matos
Oct. 02 2017