ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage syntax / 
  • Declaration and initialization
  • Hexadecimal value
  • Thousand separator
  • Specific features of PHP
  • The different types of integers
  • Differences between WINDEV 5.5 and WINDEV 2024
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
Int (Variable type)
In french: Entier
The Int type is used to easily perform calculations on integer values. Integer variables can have a value ranging from -2 x 109 to 2 x 109 (approximately).
Remark: For advanced calculations, WLanguage offers different types of integers.

The Int type supports null values. For more details, see Allowing nullable types.
Example
i is int
i = 5
Syntax
<Variable name> is int

<Variable name 1>, <Variable name  2> are int
<Variable name>:
Name of the variable to declare.
Remarks

Declaration and initialization

An "Integer" variable that is declared but not initialized is equal to 0.

Hexadecimal value

To enter a hexadecimal value in the code, the hexadecimal value must be prefixed by "0x".
MyVariable is int
MyVariable = 0x4D5
Remark: The '_' character can be used as block separator in the hexadecimal numbers. The blocks can have a size equal to 2, 4 or 8 characters long.
Example:
Nb1 is int = 0x_12_15_A4_BC
Nb2 is int = 0x_CD4A_DE58

Thousand separator

You can use spaces and underscore characters to separate thousands in numbers. For example:
num1 is int
num1 = 123 456
let num2 = 246_789
PHP

Specific features of PHP

  • Numbers (real, integer, currency, numeric) cannot exceed 14 significant digits in PHP. If they exceed this limit, they are rounded to 14 digits.
  • The maximum value of 32-bit integers is:
    2147483647 for a 32-bit integer value <=> 0x7FFFFFFF
  • The maximum value of 64-bit integers is:
    9223372036854775807<=>0x7FFFFFFFFFFFFFFF

The different types of integers

WLanguage offers different integer types for specific operations. These types are particularly useful with Windows APIs.
Value between
  • 1-byte int
-128 and 127 (inclusive)
Example:
i is 1-byte int
Universal Windows 10 App This type of variable will be automatically converted into Integer.
  • 2-byte int
-32.768 and 32.767 (inclusive)
Example:
I is 2-byte int
Universal Windows 10 App This type of variable will be automatically converted into Integer.
  • 4-byte int
-2 x 109 and 2 x 109 (roughly)
Example:
i is 4-byte int
  • 8-byte int
-9 x 1018 and 9 x 1018 (roughly)
Example:
i is 8-byte int
  • Unsigned int
0 and 4 x 109
Example:
i is unsigned int
Universal Windows 10 AppAndroidAndroid Widget This type of variable will be automatically converted into Integer.
  • Byte
0 and 255 (inclusive)
This type is equivalent to the unsigned 1-byte integer.
Example:
i is byte
Universal Windows 10 AppAndroidAndroid Widget This type of variable will be automatically converted into Integer.
  • Unsigned 1-byte int
0 and 255 (inclusive)
Example:
i is unsigned 1-byte int
Universal Windows 10 AppAndroidAndroid Widget This type of variable will be automatically converted into Integer.
  • Unsigned 2-byte int
0 and 65.535 (inclusive)
Example:
i is unsigned 2-byte int
Universal Windows 10 AppAndroidAndroid Widget This type of variable will be automatically converted into Integer.
  • Unsigned 4-byte int
0 and 4 x 109 (roughly)
Example:
i is unsigned 4-byte int
Universal Windows 10 AppAndroidAndroid Widget This type of variable will be automatically converted into Integer.
  • Unsigned 8-byte int
0 and 18 x 1018
Example:
i is unsigned 8-byte int
Universal Windows 10 AppAndroidAndroid Widget This type of variable will be automatically converted into Integer.
  • System int
automatically adapts to the size supported by the compilation mode (4 bytes for a program compiled in 32 bits, 8 bytes for a program compiled in 64 bits).
Example:
i is system int
WINDEVWEBDEV - Server codeUniversal Windows 10 AppiPhone/iPadApple Watch Remark: SystemIntegerToInteger is used to convert a system integer into a 4-byte integer.

The exact values for these different types of integers can be found in the Limits.wl file found in the Personal\External subdirectory of the installation directory of WINDEV, WEBDEV and WINDEV Mobile.
Remark: All the advanced types (different from the "Integer" type) are recommended when using the Windows APIs.
WINDEVWEBDEV - Server codeReports and QueriesWindowsJavaUser code (UMC)PHP

Differences between WINDEV 5.5 and WINDEV 2024

The types of integers have been modified between WINDEV 5.5 and WINDEV 2024:
Type of integers in WINDEV 5.5Type of integers in WINDEV 2024
Int2-byte int
Unsigned intUnsigned 2-byte int
Long int4-byte int
Short intUnsigned 1-byte int

In WINDEV 5.5, integers were 2-byte integers by default. Since the versions 7.x, integers are 4-byte integers by default.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 04/08/2024

Send a report | Local help