Denso BHT-200QW Spécifications Page 83

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 587
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 82
Chapter 5. Data Types
75
5.5.4 Common Variables
A common variable should be declared in a main object beforehand. To share the common
variable by files other than the main object, you need to declare it with the COMMON statement
in each file where the common variable should be available.
File 1
DECLARE SUB
printaa(x)
COMMON a%
a%=2
printaa(5)
File 2
COMMON a%
SUB printaa(x)
print a%+x
SUB
To use a% as a common variable in Files 1 and 2, define the variable with the COMMON
statement in each file.
If a common variable declared with the COMMON statement is used within the SUB or
FUNCTION function in a file where the variable is defined, then the common variable will have
the same value.
(Example) COMMON aa%
FUNCTION addaa(x)
addaa=aa%+x
END FUNCTION
SUB printaa(x)
print aa%+x
END SUB
aa%=2
print addaa(2)
printaa(2)
In the above example, variables aa% used in "addaa" and "printaa" will be treated as same
one.
Vue de la page 82
1 2 ... 78 79 80 81 82 83 84 85 86 87 88 ... 586 587

Commentaires sur ces manuels

Pas de commentaire