As mentioned in the previous section, WLanguage is the programming language of WINDEV, WEBDEV and WINDEV Mobile. In this new part of the Tutorial, we will discover the basics of this language: variables, conditional statements, procedures, etc.
WLanguage is a rich language that offers multiple programming possibilities thanks to a comprehensive code editor, which makes writing code as simple as possible.
WLanguage is a 5GL. High-level functions are used for programming. One line of code in WLanguage usually corresponds to dozens of lines in a 4GL.
WLanguage is event-driven. Code is written in the corresponding WLanguage event. For example, this event can be associated with a control, window, page, report, etc. All events are available in the code editor. You can add additional events and manage special cases through programming.
You can also use object-oriented programming (OOP). Member and method, constructor, destructor, multiple inheritance, virtual method, polymorphism, etc. One lesson in this part is entirely dedicated to OOP.
Programming controls or objects is very simple, using specific functions and/or properties. Simply type the name of the control or object in the code editor to see all the functions or properties that can be used with it.
WLanguage functions that use controls or objects accept two syntaxes:
- standard syntax. In this case, WLanguage functions start with the name of the corresponding "family" name. Thus, all the functions used to manipulate Table controls start with "Table".
For example, to add elements in a Table control, you can use TableAddLine, specifying the name of the Table control as the first parameter:
// Add "Moore" and "Vince"
// in the last row of the "TABLE_ProductTable" control
TableAddLine(TABLE_ProductTable, "Moore", "Vince")
- prefix syntax.
In this case, the name of the manipulated element is specified first. With the previous example, we can simply use AddLine on the Table control:
// Add "Moore" and "Vince"
// in the last row of the "TABLE_ProductTable" control
TABLE_ProductTable.AddLine("Moore", "Vince")
Remark: The prefix syntax will be used for manipulating controls or objects in this tutorial.
All these aspects of WLanguage programming will be covered in the different lessons and parts of this tutorial.
Before you start using WLanguage, here are some WLanguage conventions to consider:
- WLanguage doesn't use end of line characters.
- The '//' characters are used to comment out lines of code. These lines of code are not interpreted. They provide better code readability.
- In the WLanguage functions, the parameters passed to the function are enclosed in brackets.
- Parameters are separated by commas.
- WLanguage is not case sensitive.
- "Spaces" are not interpreted.
- Points are used as decimal separators.
- WLanguage functions are in English. They are also available in French.