ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage syntax / Declaring variables
  • Declaration of type aliases
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
A "type alias" is a redefinition of an existing type. This alias can be used as a standard WLanguage variable type.
Example
// Exemple 1: Déclaration d'alias de type
// -- Initialisation du projet
PrixPoudre is type: numeric (5,4)
// PrixPoudre est un nouvel alias de type Numérique avec: 
// 5 chiffres pour la partie entière
// 4 chiffres pour la partie décimale
// Exemple 2: Déclaration, initialisation et utilisation des alias de type
// -- Initialisation du projet
Prix is type: currency
PrixHorsTaxes is type: currency
TauxTVA is type: numeric
// Clic sur BTN_Calcul
PrixHT_Voiture is PrixHorsTaxe = 625000
TauxTVA_Voiture is TauxTVA = 20
FraisDouane_Voiture is Prix = 62500
PrixTotal is Prix = CalculeTarif(PrixHT_Voiture, TauxTVA_Voiture, FraisDouane_Voiture)
PROCEDURE CalculeTarif(MonPrix is PrixHorsTaxes, mTauxTVA is TauxTVA, FraisDouane is Prix):Prix
PrixTTC is Prix = MonPrix + mTauxTVA * MonPrix/100) + FraisDouane
RETURN PrixTTC
Syntax

Declaring a type alias Hide the details

<Nom de l'alias> est type: <Type de l'alias>
END
<Alias name>:
Name of new type to be defined.
<Alias type>:
Type of variable corresponding to the alias.

Declaring a variable using a type alias Hide the details

<Variable name> is <Alias name>
<Variable name>:
Name of the variable to declare.
<Alias name>:
Name of a previously declared alias.
Remarks

Declaration of type aliases

Type aliases must be declared in:
  • The project initialization code so that it can be used in all the WLanguage events of the project (code of the project, windows, controls, procedures, etc.).
  • The global declaration code of a window so that it can be used in all the WLanguage events of the window (code of the window, controls in the window, local procedures, etc.).
  • The opening code of a report so that it can be used in all the WLanguage events of the report (code of the report, controls in the report, local procedures, etc.).
  • The class declaration code so that it can be used in the class.
  • The declaration code of a set of procedures so that it can be used in all the procedures of the set.
Remarque: A type alias is always global:
  • to a project,
  • to a window,
  • to a report,
  • to a class.
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/19/2024

Send a report | Local help