AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Sintaxis WLanguage / Procedimientos WLanguage
  • Overview
  • Overloading 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?
  • Remarks
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
WLanguage proposes the "WL." keyword to:
Overloading a WLanguage function
WINDEVWEBDEV - Código ServidorReportes y ConsultasAndroidWidget Android iPhone/iPadApple WatchJavaCódigo de Usuario (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 standard WLanguage function Info, you can use a custom procedure named Info. The custom procedure will be run whenever Info is called.
WINDEVWEBDEV - Código ServidorReportes y ConsultasAndroidWidget Android iPhone/iPadApple WatchJavaCódigo de Usuario (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).
Remarks:
  • Overloading WLanguage functions is ignored during the dynamic compilation. For example, if Trace has been overloaded, the WLanguage function (not the overloaded function) will be called in a code that is dynamically compiled.
  • Overloaded WLanguage functions are not taken into account in the processes of an internal window, if the overload is in the window that contains the Internal Window control.
  • If the WLanguage function has multiple syntaxes (e.g., ToastDisplay), the overloaded function will be executed regardless of the syntax called. If the WLanguage function has multiple syntaxes with parameters of different types, the new procedure will need to have multiple syntaxes if it is to match all the call possibilities.
  • You have the ability to overload functions that handle windows, pages or reports. Simply use the following notation to define the parameter corresponding to the desired 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 procedure code will be:
      PROCEDURE Open(WindowName is string <window name>, *)
    • WEBDEV - Código Servidor 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>, *)
    For more details, see Procedure parameters.
WINDEVWEBDEV - Código ServidorReportes y ConsultasAndroidWidget Android iPhone/iPadApple WatchJavaCódigo de Usuario (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:
PROCÉDURE 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 an SQL query. This SQL query can be executed on HFSQL data files. You can for example use the WLanguage functions to create advanced selection conditions.
You can use WLanguage functions:
  • directly in the SQL code of a query,
  • in the query editor (e.g., when creating a calculation item that uses a mathematical formula)
  • with queries defined by the SQL query type.
Android In Android, you can use WLanguage functions in SQL queries only:
  • with HFSQL Client/Serveur databases.
  • with queries created in the query editor.
WLanguage functions cannot be used in an SQL query.

How to?

To use the WLanguage functions in queries for HFSQL:
  1. Create a query in the query editor.
  2. To use WLanguage functions in the query, use the notation: WL.<Nom de la fonction>
    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:

Remarks

  • 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.
  • 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 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
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 06/12/2024

Señalar un error o enviar una sugerencia | Ayuda local