|
|
|
|
|
- Declaration of type aliases
A "type alias" is a redefinition of an existing type. This alias can be used as a standard WLanguage variable type.
PrixPoudre is type: numeric (5,4)
Prix is type: currency
PrixHorsTaxes is type: currency
TauxTVA is type: numeric
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.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|