PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | French EN
  • Overview
  • Simple variables
  • Notes
  • Limit values of data types
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
Overview
A variable is defined by name and type.
The variable type defines the values that can be taken by the variable, its memory footprint and the available operations.
The different types of variables are:
Simple variables
The "simple" types of WLanguage are as follows (these types can be declared directly, see Declaration of variables):
  • Boolean: recommended type for logical operations with two possible values:
    • True (value different from 0)
    • False (value equal to 0)
      Example: b is boolean
  • Integer: recommended type for calculations with integer values.
    For advanced calculations, WLanguage offers different types of integers.
    Example: b is int
  • Currency: recommended type for calculations with real values that require absolute precision for decimals, e.g., currency values.
    A currency supports 24 significant digits (up to 17 digits for the integer part and 6 digits for the decimal part). The number can contain up to 6 decimals.
    More details about the Currency type.
    Example: MyCurrency is currency
  • Numeric: recommended type for calculations with real values that require absolute precision for decimals.
    A numeric supports 38 significant digits (up to 32 digits for the integer part and 6 digits for the decimal part). The number can contain up to 6 decimals.
    More details about the Numeric type.
    Example: MyCurrency is numeric
  • Real: recommended type for simple calculations with real values.
    A real supports 15 significant digits but it does not necessarily contain precise decimals. The precision of decimals is not guaranteed. To perform precise calculations, use the "Currency" type.
    For advanced calculations, WLanguage offers different real types.
    Example: VAT is real
  • String: recommended type for characters and character strings.
    With this type, there is no need to declare the length of the string. It can change when the variable is used.
    For an advanced management of character strings (especially for Windows APIs), WLanguage offers different types of strings.
  • Buffer: recommended type for portable code between WINDEV and WINDEV Mobile. See The buffer type for more details.
  • Date, Time, DateTime, Duration: recommended types for dates and times.
    The "Date" and "Time" types enable you to easily handle dates and times, and to manage conversions almost automatically.
    More details about the Date type and More details about the Time type.
    The "DateTime" type is used to simultaneously manage dates and times.
    More details about the DateTime type.
    The "Duration" type allows you to easily manage the difference between dates and times.
    More details about the Duration type.
  • Variant: recommended type for any simple type of WLanguage.
    The Variant type is used to handle ActiveX or manage the NULL value.
    More details about the Variant type
Notes

Limit values of data types

  • If a variable is assigned a value that exceeds the limits of its type:
    • an error message is generated when running the test of a window, page or project.
    • no error message signals the capacity overflow when the program is run. The value of the variable is incorrect.
  • To know the limit values of the different data types, see the "Limits.WL" file in the "Personal\Extern" subdirectory of WINDEV, WEBDEV or WINDEV Mobile. This file can be opened by any text editor.
  • To simplify your tests, the limit values of the different data types have been associated with constants in the "Limits.WL" file. To include these constants in your application, use the following code line in the initialization code of your project:
    EXTERN "Limits.WL"

    The "Limits.WL" file will be automatically searched in the "Personal\Extern" subdirectory of WINDEV, WEBDEV or WINDEV Mobile. There is no need to copy the "Limits.WL" file to the project directory. See the help about External for more details.
    Reminder: Each simple type is identified by a WLanguage keyword. These keywords are reserved words.
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment