PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • 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.
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:
    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
    Reports and Queries

    Other possibilities

    • 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 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.
    Component : wd240vm.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