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 / Declaración de variables
  • Lifespan of a dynamic automation object
  • Allocating a dynamic object
  • Passing parameters to a method
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
A dynamic automation object is an automation object allocated upon request, during the program execution. The Automation objects are used to handle software such as Office 2007 (Word, Excel, etc.).
Ejemplo
// Déclaration d'un objet automation dynamique
MonObjetDynamique is object Automation dynamic
// Création d'un objet automation dynamique
MonObjetDynamique = new object Automation MonServeur
// Appeler une méthode d'un objet automation dynamique
MonObjetDynamique>>FichierOuvrir(NomDoc)
Sintaxis

Declaring a dynamic automation object Ocultar los detalles

<Name of dynamic automation object> is dynamic automation object
<Name of dynamic automation object>: Character string
Name of the dynamic automation object to declare.

Creating a dynamic automation object Ocultar los detalles

<Name of dynamic automation object> = new automation object <Name of automation server>
<Name of dynamic automation object>: Character string
Name of the dynamic automation object to create. This object was declared beforehand.
<Name of automation server>: Character string
Name of the server of dynamic automation object.

Call a method of a dynamic automation object Ocultar los detalles

<Name of dynamic automation object>>><Method name>([<Parameters>])
<Name of dynamic automation object>: Character string
Name of the dynamic automation object to use. This object was previously declared and allocated.
<Method name>: Character string
Name of the method of the dynamic automation object to run. This method is given by the server.
Note: The list of methods that can be used depends on the automation server. For more details, see the documentation about the server.
<Parameters>: Any type (optional)
Parameters passed to the method.
Observaciones

Lifespan of a dynamic automation object

The dynamic automation object is created when allocating the object.
The dynamic automation object is automatically destroyed at the end of the process containing its declaration or when a new allocation is performed on the object.
A dynamic automation object declared "global" in the code:
  • that initializes a window will be destroyed at the end of the closing process of the window.
  • that initializes a project will be destroyed at the end of the closing process of the first project window.
To explicitly free a dynamic automation object, use the following syntax:
Libérer <Nom de l'objet automation dynamique>

Allocating a dynamic object

  • When allocating a dynamic automation object, the automation server is automatically started.
  • To allocate a dynamic automation object with an existing instance of an automation server, use GetActiveObject.

Passing parameters to a method

  • The methods of automation servers can accept one or more parameters.
  • When calling a method, the sequence of parameters must be respected (for more details, see the documentation).
  • With some automation servers, some method parameters are not valued: only the presence of the parameter is important. The value taken by this parameter has no importance.
    For example, the "EditReplace" method of Word Basic accepts 10 parameters, the last one (ReplaceAll) being not valued.
    In WLanguage, any ordinary value can be passed to non-valued parameters.
  • The methods of some automation servers can accept optional parameters located anywhere in the list of parameters.
In WLanguage, the optional parameters must necessarily be found after the mandatory parameters.
To give any ordinary value to an optional parameter, assign the * character to the optional parameter. On the contrary, this character will not be required for the optional parameters found after the last mandatory parameter.
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: 21/09/2024

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