Tuto WINDEV Mobile 25
Part 4: Programming concepts 81 The variables What is a variable In a programming language, a variable is used to store data. These memory sections contain strings, numbers, etc. The variables are used to perform calculations, to perform comparisons or to store information that will be used later. A variable is represented by: • a name: Name given to the variable so that it can be used by the language. • a type: Nature of data stored in the variable (see The types of variables). • a value: Information stored in the variable. • a scope: Limit for using the variable in the program (see The scope of variables). The scope is mainly defined by the location where the variable is declared. Declaring and assigning a variable The variable must be declared (which means created) before it can be used. • Example of simple declaration: Price is currency • Price represents the variable name. • is is used to declare the variable. The everyday language is used in WLanguage. • currency corresponds to the variable type.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==