
12. Expressioni, Registri e Funzioni
Per dare alle pagine HTML una maggiore flessibilità di programmazione,
alcune funzioni permettono l’utilizzo di semplici espressioni aritmetiche
con numeri interi nei loro parametri o nell’assegnazione di valori.
Le espressioni aritmetiche comprendono numeri, registri (vedi
paragrafo successivo), o una combinazione di entrambi:
Numero
- esempio: Var(1, 1, 1)
Registro
- esempio: Var(1, 1, Index)
Espressione complessa
- esempio: Var(Address - 1, Type,
Index + 1)
Graficamente, un’espressione potrebbe avere questo aspetto:
Le funzioni principali che permettono l’utilizzo di espressioni nei loro
parametri sono:
• Var (per i parametri <address>, <type> e <index>)
• Eval
• UserLevel
• UserLevelString
• UserName
• UserPwd
Le funzioni principali che permettono l’utilizzo di espressioni
nell’assegnazione di valori sono:
• Set
• SetMin
• SetMax
• UserLevel
12.1 Registri
Un “registro” è una stringa alfabetica che non fa distinzione tra
maiuscole e minuscole, contiene un massimo di 16 caratteri e
rappresenta un numero intero compreso tra–2-31+1 e 231-1.
Per creare un registro, potete utilizzare le funzioni “Set”, “SetMin” o
“SetMax”.
Nell’utilizzo dei registri, sono da tenere in considerazione questi punti:
• Ai registri non è permesso assumere valori che superino i limiti
imposti dalle funzioni “SetMin” e “SetMax”. Se un’espressione ha
come risultato un valore più basso o più alto, questo verrà riportato
entri i limiti imposti.
• Oltre ai registri predefiniti di sola lettura, possono essere abilitati un
massimo di 8 registri utente nello stesso momento. Quando si crea il
9° registro, il più vecchio in ordine cronologico viene eliminato.
• I registri sono una risorsa condivisa e non protetta. Non è richiesto
un livello di accesso per leggerli o scriverli. Possono quindi venire
utilizzati o eliminati in qualsiasi momento, da qualsiasi pagina HTML
o da consolle.
Si noti che due o più utenti che accedono a pagine che contengono
gli stessi registri, possono interferire l’uno con l’altro. In genere, si
tratta di episodi rari, tuttavia, dal momento che non si possono
escludere del tutto, consigliamo di porre particolare attenzione
affinché non accadano (utilizzate i registri solo se necessario e solo
quando c’é un unico utente in possesso della password necessaria
per accedere a quelle pagine).
• I registri vengono azzerati in seguito ad un riavvio del WebGate.
12. About Expressions, Registers and Functions
To provide HTML pages with greater programming flexibility, some
functions allows the use of simple integer arithmetic expression in their
parameters or assignments.
Arithmetic expressions can consist of numbers, registers (explained in
the paragraph below), or a combination of the two in the following
manner:
Number
- example: Var(1, 1, 1)
Register
- example: Var(1, 1, Index)
Complex expression
- example: Var(Address - 1, Type, Index + 1)
Graphically, an expression could be indicated as below:
The principal functions that allow the use of expressions in their
parameters are:
• Var (for <address>, <type> and <index> parameters)
• Eval
• UserLevel
• UserLevelString
• UserName
• UserPwd
The principal functions that allow the use of expressions for the
assignment are:
• Set
• SetMin
• SetMax
• UserLevel
12.1 Registers
A “register” is an alphabetic, non case-sensitive string of at most 16
characters, representing a signed integer number comprised between
–2-31+1 and 231-1.
To create a register use the “Set”, “SetMin” or “SetMax” functions.
When using registers, please consider the following points:
• Registers are never allowed to assume values exceeding the limits
imposed by “SetMin” and “SetMax” functions. If an expression results
in a value lower or greater it will be limited.
• In addition to the predefined read only registers, at most 8 user
defined registers are allowed at the same time. When the 9th register
is created, the oldest one is discarded.
• Registers are a shared and unprotected resource. No access level is
required to read or write to any of these. They can be accessed and
discarded at any time from any HTML page or from the console.
Moreover, care must be taken because two or more users accessing
to pages using the same registers may interfere each other. This may
occur only in rarely occasions but since inevitable, make sure to avoid
such situations (for example, use registers only when absolutely
necessary and only when a single user have the password to access
to those pages).
• Registers are reset after a WebGate reboot.
79
Manuale WebGate - cod. +030220230 rel. 1.0 - 16.09.2003
+
-
Number
Register
Fig. 12.1