PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • In this lesson you will learn the following concepts
  • Overview
  • A project to discover WLanguage
Appendix 2. WLanguage: Overview
In this lesson you will learn the following concepts
  • What is WLanguage?
  • How to discover WLanguage?
Lesson duration

Estimated time: 5 min
Previous LessonTable of contentsNext Lesson
Overview
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 event. 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 and more, ... 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.
A project to discover WLanguage
In this part, we will focus on the WLanguage code.
To do so, we will create a project (necessary for any programming task with WEBDEV). In this project, we will write the WLanguage code directly in the code editor. This code can be tested immediately, by simply clicking "GO".
  • To create our working project:
    1. Start WEBDEV.
    2. Go to the WEBDEV home page if necessary (Ctrl + <).
    3. On the home page, click "Create a project" and select "Site". The project creation wizard starts. The different steps of the wizard will help you create your project. The information specified in this wizard can be modified later.

      Tip

      To create a project, you can also:
      1. Click Create an element in the quick access buttons.
      2. The element creation window appears: click "Project".
    4. For this lesson, we are going to create a "blank" project. You can also create a project based on an existing example, provided with WEBDEV. Select "Create a blank project" and go to the next step of the wizard.
    5. WEBDEV then prompts you to indicate the characteristics of the site. Keep the default option ("WEBDEV site"). Go to the next step of the wizard.
    6. Keep the default option ("Session Mode (Classic)"). Go to the next step of the wizard.
    7. The wizard prompts you to enter the project name, location and description. In our case, this project will simply be named "WLanguage".
    8. By default, WEBDEV proposes to create this project in the "\My sites\WLanguage" directory. You can keep this location or change it via the [...] button.
    9. The different steps of the wizard appear on the left. These steps can be clicked directly. Since the other steps are not strictly necessary for this project, you can go to the "End" step directly.
    10. Click "Finish": the project is created. The element creation window appears.
    11. To simplify the test of our project, we will create a page that will be defined as "First project page":
      • In the element creation window, click "Page" then "Page".
      • In the wizard, select "Blank" and validate ("OK").
      • Save the page.
      • In the "Project explorer" pane, expand "Pages" and open the context menu of "PAGE_NoName1".
      • Select "First page of the project in session mode".
Our project will now let us discover the different functionalities of WLanguage.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 26
Comments
Click [Add] to post a comment