|
|
|
|
|
- Overview
- Global variable
- Variables global to a project
- Variables global to a window
- Variables global to a page
- Variables global to a report
- Variables global to a set of procedures
- How to use a global variable from a component
- Global Variable: Syntax
- Declaring one or more global variables
- Local variable
- Local variable: Syntax
- Declaring one or more local variables
- Zombie local and global variables
Global and local variable
Two types of variables are available: - Local variable: can only be used in the process in which this variable has been declared.
- Global variable: can be used in all processes depending on the process in which this variable has been declared.
Important: Do not declare two variables with the same name (in particular, a global variable and a local variable). Variables global to a project Global variables declared in the "Initialization" event of a project can be used in all the events or processes: - of the project.
- of the window or page (events of the window or page, of its controls and of the associated local procedures).
- of the report (events of the report, of its controls and of the associated local procedures).
Variables global to a set of procedures Global variables declared in the "Declaration" event of a set of procedures can be used in all the events or processes: - of the different procedures in the set.
- of the current project.
How to use a global variable from a component Since the purpose of a component is to be stand-alone, no global variable of the project should be used from this one. However, the recommended method is as follows: - create a global variable in the component.
- in the component, create a procedure used to initialize these global variables.
- from the "Initialization" event of the project and whenever the value of the global variables of the project is modified, call this procedure to assign a similar value to the global variables of the component.
Declaring one or more global variables GLOBAL <Variables globales> Details of syntax | | GLOBAL | Beginning of declaration of global variables. | <Global variables> | Global variables to declare. |
GLOBAL
Indice is int
NomClient is string
Taux is real
LOCAL
I is int
PrénomClient is string
Prix is currency
Local variables can only be used in the events or processes in which they are declared. Outside of these events or processes, local variables are unknown. These variables cannot be shared by several events or processes. By default, a variable is local when it is declared. Declaring one or more local variables [LOCAL] <Variables locales> Details of syntax | | LOCAL | Beginning of declaration of local variables. The LOCAL keyword is optional. | <Local variables> | Local variables to declare. |
LOCAL
I is int
PrénomClient is string
Prix is currency
I is int
PrénomClient is string
Prix is currency
Zombie local and global variables A local or global variable can become obsolete. This allows you to in know that this element must not be used anymore (but that it is not deleted yet). To declare a variable as being obsolete, all you have to do is use the <Zombie> extension attribute. The syntax is as follows: <Nom Variable> est un <type de la variable> <zombie [commentaire = "texte"]> In this syntax, the optional comment keyword is used to specify the text that will be displayed in the compilation error associated with the obsolete variable. Example: PrénomClient is string <zombie commentaire = "Ne plus utiliser - utiliser la structure Client">
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|