Tuto WINDEV 25
Part 2: The WLanguage basics 45 Declaring 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. • Example of multiple declaration: LastName, FirstName are strings • LastName, FirstName represent the names of variables. • are is used to declare a set of variables. • strings represents the type of variables. Assignment and use When the variable is declared, you have the ability to assign it (or to give ti a value). For example: // Assign a currency variable Price = 1256.67 // Assign a string variable LastName = "Doe" The = operator is used to perform this assignment. Remark In WLanguage, the " character (double quote) is the character used to delimit a character string. In the above example, the doubles quotes are used to assign the Doe value to the LastName variable. The variable content can be read and handled: all you have to do is use the name given to the variable to access it. The following example is used to read and display the content of Price variable on the screen: Info(Price)
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==