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
  • Special case: the dynamic arrays
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
New is used to allocate memory space to contain:
Ejemplo
// Syntaxe 1
TableauClient is array dynamic
// Allocation de ce tableau dynamique
TableauClient = new array dynamic of 4 by 7 int
// Syntaxe 2
MFichier is Class 
	Nom is string
	Extension is string
	Répertoire is string
END
FichierSource is object MFichier dynamic
...
// Instanciation de l'objet
FichierSource = new MFichier
// Traitement sur l'objet
// Syntaxe 3
// Création d'un objet automation dynamique
MonObjetDynamique = new object Automation MonServeur
// Syntaxe 4
RefProduit is Structure
	CodeF is int
	CodePr is string fixed on 10
END

Fauteuil is RefProduit dynamic
Chaise is RefProduit dynamic
...
Fauteuil = new RefProduit
Fauteuil:CodeF = 7
Fauteuil:CodePr = "Meuble"
Sintaxis

Allocate a dynamic array Ocultar los detalles

<Nom du tableau dynamique> = allocate a dynamic array of <Dimension 1> [by <Dimension 2>... [by <Dimension 10>]] <Type des éléments du tableau>
OR
<Nom du tableau dynamique> = allocate a dynamic array of <Dimension 1> [, <Dimension 2>... [, <Dimension 10>]] <Type des éléments du tableau>
<Name of dynamic array>:
Name of the dynamic array to be used. This array must have been declared previously.
<Dimension 1>...<Dimension 10>:
Dimensions of the array from 1 to 10 (integer).
<Type of array elements>:
Type of the elements in the array.
Remarks:
  • The keywords un and dynamique are not mandatory: they are approval words.
  • For more details, see Arrays.

Instantiating a dynamic class object Ocultar los detalles

<Object name> = new <Class name> ([<Parameters>])
<Object name>:
Name of the class instance.
<Class name>:
Name of the class to instantiate. This name was defined when the class was created in the code editor.
<Parameters>:
Optional parameters of constructor.
For more details, see Dynamic instantiation of object.

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>:
Name of the dynamic automation object to create. This object was declared beforehand.
<Name of automation server>:
Name of the server of dynamic automation object.
For more details, see Dynamic automation object.

Creating a dynamic structure variable Ocultar los detalles

<Variable name> = new <Name of dynamic structure>
<Variable name>:
Name of the dynamic structure variable to create.
<Name of dynamic structure>:
Name of a structure that was declared beforehand.
For more details, see Dynamic structure.
Observaciones

Special case: the dynamic arrays

If the dynamic array is declared and assigned in a single line of code, there is no need to use the New keyword to reserve memory space.
For example:
// Déclaration et allocation d'un tableau dynamique
TableauClient is array dynamic of 4 by 7 int

// Est équivalent à

TableauClient is array dynamic
TableauClient = new array dynamic of 4 by 7 int
Remark: In this case, don't use the Delete keyword to explicitly free the dynamic array.. A runtime error will occur if Delete is used.
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: 24/09/2024

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