PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • Other possibilities
  • 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
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.
PHP This function has no effect in this version.
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.
  • WEBDEV - Server code In a REST Webservice, this parameter always corresponds to False.
  • PHP This parameter always corresponds to False.

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.
Remark: 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:
tmPageTest run from a page Go.
tmProcedureTest run from a procedure Go.
tmProjectTest run from a project Go.
tmQueryTest run from a query Go.
tmReportTest run from a report Go.
tmTestTest run from the Go of an automatic test.
tmWindowTest run from a window Go.
Remarks
WEBDEV - Server code

Other possibilities

  • InSimulatorMode is used to differentiate between the test mode on the mobile device and on the simulator.
  • WEBDEV - Server code InReportsAndQueriesMode is used to differentiate between the test mode from the report editor and the test mode from Reports & Queries.

Availability of the function

InTestMode can be used in all IDEs to allow for cross-platform code. Functions or procedures that use InTestMode can be shared between several products without generating any compilation error.
Business / UI classification: Neutral code
Component: wd280vm.dll
Minimum version required
  • 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
02 Oct. 2017