beautypg.com

Rpbasic-52 programming guide – Remote Processing BASIC 52 User Manual

Page 33

background image

RPBASIC-52 PROGRAMMING GUIDE

2-14

The a bove e xam ple sho ws tha t ON TIC K con tinues to run a fter a C LEA R sta teme nt but v ariable s are cl eared .
If a program error were generated after the clear, the program would stop because ONERR w as cleared.

The next e xample d emonstrate s how C LEA R S can b e used in a FO R-NE XT loop . A C-ST ACK error is
returned if the CLEAR S is not in line 20.

10 FOR N=0 TO 10
20 IF N=5 THEN CLEAR S : GOTO 10
30 PRINT N
40 NEXT

>RUN
1
2
3
4
0
1