Examples
Price is currency
LastName, FirstName are strings
The following example is used to read and display the content of Price variable on the screen:
Info(Price)
Simple variables
The "simple" types of WLanguage are as follows (these types can be declared directly, see Declaration of variables):
•Boolean: recommended type for all the logical operations where only two alternatives are possible:
•True (value different from 0)
•False (value equal to 0)
Example: b is boolean
•Integer: recommended type for the calculations performed on integer values.
For advanced calculations, the WLanguage proposes different types of integers.
Example: b is int
•Currency: recommended type for the calculations performed on real values that require an absolute precision for the decimals, as currency values for example.
A currency manages 24 significant digits (up to 18 digits for the integer part and up to 6 digits for the decimal part). The precision is precise to 6 decimals.
For more details about the currencies.
Example: MyCurrency is currency
•Numeric: recommended type for the calculations on real values that required an absolute precision for the decimals.
A numeric manages 38 significant digits (up to 32 digits for the integer part and up to 6 digits for the decimal part). The precision is precise to 6 decimals.
For more details about the numerics.
Example: MyCurrency is numeric
•Real: recommended type for the simple calculations performed on real values.
A real manages 15 significant digits but the precision of the decimals is not guaranteed. The precision of decimals is not guaranteed. To perform precise calculations, use the "Currency" type.
For advanced calculations, the WLanguage proposes different real types.
Example: VAT is real
•String: recommended type for managing the characters and the character strings.
With this type, there is no need to declare the length of the string. This one can freely change when using the variable.
For an advanced management of character strings (especially for the Windows APIs), the WLanguage proposes different types of strings.
•Buffer: recommended type for writing code that is portable between WINDEV and WINDEV Mobile. See The buffer type for more details.
•Date, Time, DateTime, Duration: recommended types for managing the dates and the times.
The "Date" and "Time" types enable you to easily handle the dates and the times, and to manage the conversions almost automatically.
More details about Dates and More details about Times.
The "DateTime" type is used to manage a date and a time at once.
For more details about DateTime.
The "Duration" type allows you to easily manage the difference between dates and times.
For more details about the durations.
•Variant: recommended type for storing any simple type of WLanguage.
The Variant type is used to handle the ActiveX or to manage the NULL value.