Remote-processing BASIC 52 Uživatelský manuál Strana 96

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 163
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 95
RPBASIC-52 PROGRAMMING GUIDE
2-77
ONTICK
Syntax: ONTICK time,line number
Where: time = time interval from 0.01 to 327
line number = line to branch
Function: Calls subroutine at line number every time interval.
Mode: Run
Use: ONTICK 1.25,500
Cards: All
DESCRIPTION
ONTICK calls a subroutine every time interva l. time ranges from 0.010 seconds to 327.7 seconds
(approxima tely 5.5 minutes). time can be specified in increments as small as 0.005 seconds. ONTICK
interrupts are turned off when time = 0. A line number must still be provided even though it is not used.
The interval period can be reset at any time in a program. When an ONTICK statement is executed, an
interrupt will occur in time seconds. Time accumulated since the last interrupt is discarded.
NOTE: Use the RE TI com man d to exit this su broutine. Failure to do so prev ents future ONTICK interrup ts.
Make sure your ONTICK subroutine can finish before the next interrupt. If the program is in the subroutine
longer than the specified time interval, the next one will be missed.
This interrupt has the highest priority of any others. ONITR can interrupt any other routine, but no other
interrupt can take over this one.
RELATED
RETI
ERRORS
BAD ARGUMENT When time > 327.6 or negative
BAD SYNTAX When any parameters left out
INVALID LINE When line number not found
EXAMPLE
The following example will interrupt 5 times before it is canceled at line 220.
10 A = .15
20 ONTICK A,200
30 IF C<4 THEN A=A+1 : GOTO 30
40 END
200 PRINT A
210 C = C + 1
220 IF C = 5 THEN ONTICK 0,200
230 RETI
>run
145.15
286.15
431.15
575.15
The IDLE com mand m ay be used to "wait" for an O NTICK interval interrupt.
Zobrazit stránku 95
1 2 ... 91 92 93 94 95 96 97 98 99 100 101 ... 162 163

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

Žádné komentáře