Denso BHT-200QW Especificaciones Pagina 79

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 587
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 78
Chapter 5. Data Types
71
5.5 Scope of Variables
You may scope work variables and register variables to be local or global with the PRIVATE
or GLOBAL statement, respectively.
(1) Global variables
A global variable can be accessed by any routine in source files to share information
between those routines. Before access to it, you need to declare it with the GLOBAL
statement.
(2) Local variables
A local variable can only be accessed by any routine in a source file where it is
defined.
Before access to it, you need to declare it with the PRIVATE statement.
(3) Variables not declared to be global or local
If not declared to be global or local, a variable is closed in each file where it is defined.
A variable used inside the FUNCTION or SUB function without declaration is available
only within a function where it is defined.
You may also share variables between user programs when one program chains to another
by declaring variables to be common with the COMMON statement.
5.5.1 Global Variables
A global variable can be shared between source files in a program. In each file where you
want to use a particular global variable, write GLOBAL preceding a desired variable name or
DEFREG statement.
(Example) GLOBAL aaa%
GLOBAL bbb$[10]
GLOBAL ccc$(5,3)[30]
GLOBAL DEFREG ddd
GLOBAL DEFREG eee%(5)
(Example 1) To share the variable aa% between Files 1 and 2, define aa% by using the
GLOBAL statement in each file as follows:
File 1
GLOBAL aa%
File 2
GLOBAL aa%
Before access to a global variable, you should define it.
Vista de pagina 78
1 2 ... 74 75 76 77 78 79 80 81 82 83 84 ... 586 587

Comentarios a estos manuales

Sin comentarios