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 / Palabras clave reservadas
  • General properties on the parameters of a procedure
  • Handling the parameters of a procedure
  • Specific properties that can be used on each parameter of a procedure
  • Re-stacking parameters
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
MyParameters (Reserved word)
 
The MyParameters keyword is used to handle the parameters passed to a WLanguage procedure. It allows you to access the advanced information about the parameters of the current WLanguage procedure.
You have the ability to handle all the parameters or a single parameter.
This keyword can be used in the standard WLanguage procedures and in the WLanguage procedures with a variable number of parameters.
Ejemplo
// Procedure used to shift controls
PROCEDURE ShiftControl(*)

// This code uses a POUR loop ... _A_ 
// to avoid recalculating the number of parameters at each iteration
// Indeed, this number of parameters is fixed. 
FOR I = 1 _TO_ MyParameters..Count
	MyParameters[I]..X += 10
END
Sintaxis
MyParameters
Observaciones

General properties on the parameters of a procedure

Two properties can be used on all the parameters of a WLanguage procedure:
Property nameEffect
NbReceivedReturns the number of parameters actually received by the current WLanguage procedure.
OccurrenceReturns the number of parameters that can be used in the current WLanguage procedure.
WEBDEV - Código Navegador This property is not available.
Example: PROCEDURE Proc(p1, po2= "Y", po3 = "Z")
CallProc("A")Proc("A", "B")Proc("A","B", "C")
MyParameters..NbReceived123
MyParameters..Count333
The special parameter "*" (that is used to keep the default value) is counted as a received parameter.

Handling the parameters of a procedure

The standard WLanguage operations are available on each one of the procedure parameters via the following notation MyParameters[N] where N is the number of the parameter to use.
For example:
  • MyParameters[N]: Retrieves the value of the procedure's Nth parameter.
  • MyParameters[N] =: Assigns the value of the Nth parameter in the procedure.
  • MyParameters[N]++, MyParameters[N]+=, ... Combined arithmetic operations.
  • MySettings[N]..<Property Name>: Access to a property of the element.
  • MyParameters[N][...]: Access to parameter value-indexed sub-elements.
  • MySettings[N].<Sub-element>: Access to a sub-element of the parameter value.
  • MySettings[N]:<Member>: Access to a member of the parameter value
  • MySettings[N]>>xxx: Automation syntax.
Note: You can find out the type of a parameter by using the GetDefinition function.

Specific properties that can be used on each parameter of a procedure

The following properties can be used on the parameters received by a procedure:
Property nameEffect
DefaultUsed to find out whether the value of the parameter is the one passed by default or if it was explicitly specified.
ByAddress / ByReferenceUsed to find out whether the parameter was passed by default or by address.
WEBDEV - Código Navegador These properties are not available in browser code.

Re-stacking parameters

The MyParameters keyword is a simple way of restacking the parameters of a WLanguage procedure: the parameters (or part of the parameters) of the current procedure can be passed to another WLanguage procedure or function.
The possible syntaxes are:
  • MyParameters: re-stores all procedure parameters.
  • MyParameters[2 A]: restarts all procedure parameters from the second one.
  • MyParameters[A 3]: restarts all procedure parameters up to and including the third.
  • MyParameters[2 A 4]: restores all procedure parameters from the second to the fourth.
  • MyParameters[2 ON 3]: re-starts from the second of three procedure parameters.
  • MyParameters[*]: re-stores additional parameters.
Note: Parameter re-stacking does not generate a WLanguage error if the requested parameters do not exist: missing parameters are ignored.
Example: Overrides the function Opens for writing to a trace file:
PROCEDURE Open(WinName, *)
Trace(WinName)
WL.Open(WinName, MyParameters[2 TO ])
WEBDEV - Código Navegador This feature is not available.
Ver también
Versión mínima requerida
  • Versión 11
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 04/10/2024

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