Denso RC5 Specifikace Strana 255

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 692
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 254
Chapter 11 Flow Control Statements
11-5
2. Calling with reference
In calling with reference, a variable can be sent as an argument.
When you wish to designate a whole array as <Argument>, add
parentheses ( ) to the array name.
For a variable sent by calling with reference, if its contents are modified in
the called program, the modification is valid even if it returns to the calling
program.
Example 1: Calling the program of PROGRAM SUB1(AA#)
If a local variable is sent 1 CALL SUB1(DD#)
If a local variable is sent 2 CALL SUB1(DA)
(DA has been declared with DEFDBL.)
Note: A value must be assigned to a local variable beforehand.
Example 2: Calling the program of PROGRAM SUB2(BB%(10))
If a whole array is sent CALL SUB2(AB%())
(AB%(10) has been declared with DIM.)
Note (1): If there is no value assigned to a variable, an error will
occur in execution.
Note (2): If the program name is PRO <Figure>, an argument cannot
be sent.
Note (3): The number of arguments on the calling side must match
that on the called side.
Related Terms
PROGRAM
Example
DEFDBL ld1, ld2
CALL SUB1((ld1)) 'When a variable is sent as a value.
CALL SUB1(10#) 'When a constant is sent.
CALL SUB1(ld1 + ld2) 'When an arithmetic expression is sent.
Zobrazit stránku 254
1 2 ... 250 251 252 253 254 255 256 257 258 259 260 ... 691 692

Komentáře k této Příručce

Žádné komentáře