PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview
  • Overload a WLanguage function
  • Overview
  • How to overload a WLanguage function?
  • Differentiating between the WLanguage function and the custom function
  • Using WLanguage functions in the SQL queries for HFSQL
  • Overview
  • How to proceed?
  • Notes
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
WLanguage proposes the "WL." keyword to:
  • Overload a WLanguage function.
  • Use a WLanguage function in an SQL query run by the HFSQL engine.
    Versions 22 and later
    Note: The "WL." keyword also allows you to use a WLanguage constant in an SQL query containing a WLanguage function.
    New in version 22
    Note: The "WL." keyword also allows you to use a WLanguage constant in an SQL query containing a WLanguage function.
    Note: The "WL." keyword also allows you to use a WLanguage constant in an SQL query containing a WLanguage function.
Versions 16 and later
Universal Windows 10 App This feature is available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This feature is available for the Windows Phone applications.
Universal Windows 10 App This feature is available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This feature is available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This feature is available for the iPhone/iPad applications.
iPhone/iPad This feature is available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This feature is available in Windows Store apps mode.
Android Widget This feature is available in Android Widget mode.
New in version 18
Universal Windows 10 App This feature is available in Windows Store apps mode.
Android Widget This feature is available in Android Widget mode.
Universal Windows 10 App This feature is available in Windows Store apps mode.
Android Widget This feature is available in Android Widget mode.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Overload a WLanguage function
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadApple WatchWindows MobileUniversal Windows 10 AppJavaUser code (UMC)

Overview

Overloading a WLanguage function allows you to use a custom function with the same name as the WLanguage function.
For example, instead of using the WLanguage Info function, you have the ability to use a custom procedure named Info. The custom procedure will be run whenever Info is called.
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadApple WatchWindows MobileUniversal Windows 10 AppJavaUser code (UMC)

How to overload a WLanguage function?

To overload a WLanguage function:
  1. Create a new procedure in your project (local or global procedure). This procedure must have the following characteristics:
    • The same name as the WLanguage function to overload.
    • The same number of parameters as the WLanguage function to overload. These parameters must have the same type as the parameters of the WLanguage function.
  2. The custom procedure will be used instead of the WLanguage function whenever the name of the function/procedure is used in the project (or in the window if the created procedure is a local procedure).
Notes:
  • Overloading WLanguage functions is ignored during the dynamic compilation. For example, if Trace was overloaded, the call to this function in a code that is dynamically compiled will call the WLanguage function (and not the overloaded function).
  • Versions 19 and later
    You have the ability to overload the functions that handle windows, pages or reports. All you have to do is use the following notation to define the parameter corresponding to the requested element in the procedure that overloads the function:
    • WINDEVWINDEV Mobile For the windows, the parameter must be defined by the following notation "WindowName is string <window name>". For example, to overload Open, the code of the procedure will be:
      PROCEDURE Open(WindowName is string <window name>, *)
    • WEBDEV - Server code For the pages, the parameter must be defined by the following notation "PageName is string <page name>". For example, to overload PageDisplay, the procedure code will be:
      PROCEDURE PageDisplay(PageName is string <page name>, *)
    • For the reports, the parameter must be defined by the following notation "ReportName is string <report name>". For example, to overload iPrintReport, the procedure code will be:
      PROCEDURE iPrintReport(ReportName is string <report name>, *)
    See Parameters of a procedure for more details.
    New in version 19
    You have the ability to overload the functions that handle windows, pages or reports. All you have to do is use the following notation to define the parameter corresponding to the requested element in the procedure that overloads the function:
    • WINDEVWINDEV Mobile For the windows, the parameter must be defined by the following notation "WindowName is string <window name>". For example, to overload Open, the code of the procedure will be:
      PROCEDURE Open(WindowName is string <window name>, *)
    • WEBDEV - Server code For the pages, the parameter must be defined by the following notation "PageName is string <page name>". For example, to overload PageDisplay, the procedure code will be:
      PROCEDURE PageDisplay(PageName is string <page name>, *)
    • For the reports, the parameter must be defined by the following notation "ReportName is string <report name>". For example, to overload iPrintReport, the procedure code will be:
      PROCEDURE iPrintReport(ReportName is string <report name>, *)
    See Parameters of a procedure for more details.
    You have the ability to overload the functions that handle windows, pages or reports. All you have to do is use the following notation to define the parameter corresponding to the requested element in the procedure that overloads the function:
    • WINDEVWINDEV Mobile For the windows, the parameter must be defined by the following notation "WindowName is string <window name>". For example, to overload Open, the code of the procedure will be:
      PROCEDURE Open(WindowName is string <window name>, *)
    • WEBDEV - Server code For the pages, the parameter must be defined by the following notation "PageName is string <page name>". For example, to overload PageDisplay, the procedure code will be:
      PROCEDURE PageDisplay(PageName is string <page name>, *)
    • For the reports, the parameter must be defined by the following notation "ReportName is string <report name>". For example, to overload iPrintReport, the procedure code will be:
      PROCEDURE iPrintReport(ReportName is string <report name>, *)
    See Parameters of a procedure for more details.
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadApple WatchWindows MobileUniversal Windows 10 AppJavaUser code (UMC)

Differentiating between the WLanguage function and the custom function

If a WLanguage function was overloaded and if you want to use the initial function, the name of the function must be prefixed by WL. The following syntax must be used:
WL.<Function Name>
For example, to override the WLanguage function Trace, you can use the following code:
PROCEDURE Trace(Information1)
Message("Start a trace")
WL.Trace(Information1)
Using WLanguage functions in the SQL queries for HFSQL

Overview

A WLanguage function can be used in a SQL query. This SQL query can be run on HFSQL files. You can for example use the WLanguage functions to create advanced selection conditions.
The WLanguage functions can be used in the SQL code of a query or in the query editor (for example, when creating a calculation item that is using a mathematical formula).
Android In Android, the WLanguage functions can be used in SQL queries with the databases in HFSQL Client/Server format only.

How to proceed?

To use WLanguage functions in the queries for HFSQL:
  1. Create a query in the query editor.
  2. To use the WLanguage functions in the query, use the following notation: WL.<Function Name>
    The WLanguage functions can be used for example:
    • In the SQL code of the query. Example:
      -- Selecting the tasks exceeding 5 days
      SELECT Task.Caption FROM Task WHERE
      WL.DateDifference(Task.StartDate, Task.EndDate) > 5
    • In a mathematical formula handled by a calculated item.
  3. The query can be:

Notes

  • Only the WLanguage functions can be used in the queries. The properties cannot be used.
  • Several WLanguage functions can be nested in a query.
  • If the WLanguage functions is used in SELECT, the returned value is a text memo.
  • This syntax can only be used with HFSQL Classic, Mobile and Client/Server.
    Android The WLanguage functions can be used in SQL queries with the databases in HFSQL Client/Server format only.
  • The limits of the WLanguage function are identical if the function is used in a query.
  • The following functions are available in the queries:
  • To use Open, OpenChild and OpenPopup in the queries, the name of windows must be passed in character string format (between quotes).To use Open, OpenChild and OpenPopup in the queries, the name of windows must be passed in character string format (between quotes).
  • Versions 22 and later
    To use a WLanguage constant in the queries containing WLanguage functions, use the following notation: WL.<Constant Name>
    For example, SQL code of query:
    SELECT
    WL.ExtractString('A|B|C',1,'|'),
    WL.ExtractString('A|B|C',1,'|', WL.FromEnd)
    FROM
    DUAL
    New in version 22
    To use a WLanguage constant in the queries containing WLanguage functions, use the following notation: WL.<Constant Name>
    For example, SQL code of query:
    SELECT
    WL.ExtractString('A|B|C',1,'|'),
    WL.ExtractString('A|B|C',1,'|', WL.FromEnd)
    FROM
    DUAL
    To use a WLanguage constant in the queries containing WLanguage functions, use the following notation: WL.<Constant Name>
    For example, SQL code of query:
    SELECT
    WL.ExtractString('A|B|C',1,'|'),
    WL.ExtractString('A|B|C',1,'|', WL.FromEnd)
    FROM
    DUAL
Related Examples:
Overloading WLanguage functions Unit examples (WINDEV): Overloading WLanguage functions
[ + ] Overloading WLanguage functions.
This example overloads the Trace function and it is used to:
- Display a "normal" trace
- Display a trace and save the data in a file
- Perform a file trace (the information is saved in a file)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment