Accell MPC-68K Series Uživatelský manuál Strana 15

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 45
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 14
Parameter of subroutine, return value
You can set a subroutine with parameters. The parameter values are activated by the main routine
using the 'VAR' command. The command 'RETURN' ends the subroutine's program and commences
the main routines next step.
If the value combines with a local variable, some tasks can share the subroutine.
10 GOSUB *SUB 1 2 3 /* send parameter values
20 END
30 *SUB /* A!,B!,C! (with !) are local variables.
40 _VAR A! B! C! /* get parameter values in the subroutine.
50 PRINT A! B! C!
60 RETURN
10 GOSUB *SUB
20 _RET_VAL A /* get return value from the subroutine
30 PRINT A
40 END
50 *SUB
60 C!=123
70 RETURN C! /* C! = return value
15
Zobrazit stránku 14
1 2 ... 10 11 12 13 14 15 16 17 18 19 20 ... 44 45

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

Žádné komentáře