ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Miscellaneous WINDEV functions
  • Disabling JITc
  • Optimizing the external calls
  • Managing errors
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
Allows you to:
  • find out and/or modify the behavior of the application or site when some errors are generated. Depending on the selected runtime mode, these errors can be ignored or they can generate some error messages. In some cases, ExecutionMode can be used to restore the behavior of WINDEV 5.5.
  • optimize the calls to the functions declared externally. Used to optimize the runtime speed of the application in 2 cases:
    • Procedures declared externally
    • Codes compiled dynamically, call to a global or local procedure of the project.
  • find out and/or modify how the JITc is used by the application. The application uses JITc by default. It can only be disabled.
  • find out and/or modify the management mode of low references for all the instantiated objects.
Example
// Test mode?
IF InTestMode() = True THEN
ExecutionMode(NormalMode)
ELSE
// Apply the operating mode of WINDEV 5.5  
// to avoid displaying some errors
ExecutionMode(PermissiveMode)
END
Syntax

Retrieving the current runtime mode Hide the details

<Result> = ExecutionMode()
<Result>: Combination of Integer constants
Current runtime mode of application or site:
DisableOptimizedExecutionJITc (Just In Time compilation) is disabled.
ExternalCallsOptimizedOptimizes the management of external calls to procedures. This parameter is associated with one of the two following constants.
WEBDEV - Server code This constant is not available.
ForceDestructorNonDynamicObjectForces the destruction of non-dynamic objects (even if a strong reference was taken).
modeFormerOperatingModeDurationThe Duration properties keep the operating mode used in version 12.
NormalModeThe errors that occurred generate error messages.
PermissiveModeThe errors that occurred are ignored (WINDEV 5.5 or WEBDEV 1.5 mode).

Modifying the current runtime mode Hide the details

<Result> = ExecutionMode(<New runtime mode>)
<Result>: Integer constant
Runtime mode of application or site after modification.
DisableOptimizedExecutionJITc (Just In Time compilation) is disabled.
ExternalCallsOptimizedOptimizes the management of external calls to procedures. This parameter is associated with one of the two following constants.
WEBDEV - Server code This constant is not available.
ForceDestructorNonDynamicObjectForces the destruction of non-dynamic objects (even if a strong reference was taken).
modeFormerOperatingModeDurationThe Duration properties keep the operating mode used in version 12.
NormalModeThe errors that occurred generate error messages.
PermissiveModeThe errors that occurred are ignored (WINDEV 5.5 or WEBDEV 1.5 mode).
<New runtime mode>: Integer constant
New runtime mode to apply.
DisableOptimizedExecutionDisables JITc (Just In Time compilation).
ExternalCallsOptimizedOptimizes the management of external calls to procedures. This parameter is associated with one of the two following constants.
WEBDEV - Server code This constant is not available.
ForceDestructorNonDynamicObjectForces the take of low reference for all the objects.
modeFormerOperatingModeDurationThe Duration properties keep the operating mode used in version 12.
NormalModeThe errors that occurred generate error messages.
PermissiveModeThe errors that occurred are ignored (WINDEV 5.5 or WEBDEV 1.5 mode)
Remarks
WINDEVReports and QueriesUser code (UMC)

Disabling JITc

To disable JIT technology in an application, it is recommended to use ExecutionMode with the DisableOptimizedExecution constant in the project initialization code. In this case, only the elements loaded before running the project initialization code (components, sets of procedures, classes) will use JITc.
To disable JITc for a WINDEV application (e.g. problem caused by JITc), it is recommended to modify (or create) the <Executable name>.WX file. This file must be found beside the executable of the application and it must contain the following information:
[WD_EXECUTION]
OPTIM_EXECUTION=0

Optimizing the external calls

Caution: When a project is migrated from version 5.5, the permissive mode is automatically added into the initialization code of the project during the migration. The following line of code allows you to take into account the optimization of external calls:
ExecutionMode(PermissiveMode + ExternalCallsOptimized)

Managing errors

The table below presents the behavior of the application according ot the errors that occurred:
Error casePermissiveModeNormalMode
Reading an index outside the range of a Table, List Box or Combo Box control.
Examples:
s = ListA[-1]
n = ListB[56]..Color
The program returns '0' or an empty string ("") depending on the property used.A runtime error is displayed.
Example:
"Invalid index: [-1]"
Writing to a negative index of a List Box, Table or Combo Box control.
Example:
List[-1] = "Smith"
The line of code is ignoredA runtime error is displayed.
Example:
"Invalid index: [-1]"
Writing to a large index of a List Box, Table or Combo Box control.
Example:
LIST[54] = "Smith"
An empty element is inserted at the end of the List Box control and takes the specified value.A runtime error is displayed.
Example:
"Invalid index: [54]"
Using Open, OpenMobileWindow, OpenChild, OpenSister with a window name containing additional space characters.
Example:
Open("WIN1 ")
The additional space characters are deleted.A runtime error is displayed.
Example:
"The 'WIN1' window cannot be found"
Using the functions for managing popup and drop-down menus with a menu number that does not exist.
Example:
MenuMark(WIN1, 54645)
The function returns '0' and ErrorInfo is filled.A runtime error is displayed.
Example:
"The [54645] option does not exist in the menu"
Using Right and Left with a negative number of characters to extract.
Example:
Left("abcdef", -1)
The function returns an empty string ("").The function returns EOT and ErrorInfo is filled.
Using Middle with a start position that is negative and/or with a negative number of characters to extract.
Example:
Middle("abcdef", -2, -4)
The function:
  • starts the extraction from the beginning of the string if the start position is negative.
  • returns the entire source string.
The function returns EOT and ErrorInfo is filled.
Component: wd290vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/03/2023

Send a report | Local help