Tuto WINDEV 25

46 Part 2: The WLanguage basics The types of variables The variable type is used to specify the kind of information that will be stored in the variable. The most common types are: • boolean (True or False), • string ("Doe"), • integer (1234), • currency (12,32), • real (7,766666), • etc. Important Use the type corresponding to the information that must be stored. Therefore, you will optimize the memory and you will avoid calculation or process errors when using variables in the WLanguage functions. Most of these types of variables will be used in this tutorial. See the online help regarding the relevant type for more details. Remark Other types are available, such as arrays, structures, dates, times, ... Advanced variables are also available. These advanced types group all characteristics of the element currently used in a single variable. Advanced types can be used to handle XML documents, emails, XLS files, ... This type of variable will be used later in this tutorial. The scope of variables The variables can be declared anywhere in the code. However, according to the position of its declaration, the variable cannot be used to perform processes or calculations. We talk of variable scope. Two types of scope are available: • Global. • Local. Global scope Global means that the variable has an extended visibility in the code. The variable is visible outside the location where it was declared. Several levels are available: • Project and Set of procedures, • Window, Mobile Window, Page, Report.

RkJQdWJsaXNoZXIy NDQ0OA==