ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Miscellaneous WINDEV functions
  • Other possibilities
  • GO from Reports & Queries
  • 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.
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).
  • False otherwise.
Special cases:

      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
      Reports and Queries

      Other possibilities

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

      GO from Reports & Queries

      InTestMode and InReportsAndQueriesMode return True when a report is tested 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

      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: wd290vm.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

      Last update: 03/20/2023

      Send a report | Local help