Tuto WINDEV 25

Part 2: The WLanguage basics 81 ▶ Let’s now call the procedure from the calculation Button control. 1. Select the "Calculate" Button control. 2. Display the events associated with the Button control (press F2, for example). 3.  In the "Click" event, replace the existing code with the following code: SWITCH COMBO_VAT..DisplayedValue // 5.5 % CASE 5.5 EDT_PriceIOT = Calc_IOT(EDT_PriceBT, 5.5) // 10 % CASE 10 EDT_PriceIOT = Calc_IOT(EDT_PriceBT, 10) // 20 % CASE 20 EDT_PriceIOT = Calc_IOT(EDT_PriceBT, 20) END This code calls the Calc_IOT procedure to calculate the amount IOT. Two parameters are passed to the procedure: the price BT and the VAT rate. The result returned by the procedure is assigned to the EDT_PriceIOT control. 4. Close the code window (click X at the top right corner of code editor). ▶ Let’s now run the window test: 1. Run the window test ( among the quick access buttons). Give a price BT. Select the different values in the Combo Box control and click "Calculate". 2.  The amount IOT is displayed. 3. Close the test window. Conclusion This section allowed you to get familiar with the main concepts of WLanguage programming in WINDEV. Several other features are available. Some of them will be presented in this tutorial. WLanguage is a very powerful language that allows you to develop applications that use: • the Object-Oriented Programming (OOP), • the MVP (Model View Presenter), • a 3-tier programming, • advanced types (XML, Email, ...), ... See the online help regarding the relevant topic for more details.

RkJQdWJsaXNoZXIy NDQ0OA==