Home » Archimedes archive » Micro User » MU 1992-06.adf » PD » BASS/Comms/TimeOut/ExTimeOut

BASS/Comms/TimeOut/ExTimeOut

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Micro User » MU 1992-06.adf » PD
Filename: BASS/Comms/TimeOut/ExTimeOut
Read OK:
File size: 05C5 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >ExTimeOut
   20REM A small example concerning the 'TimeOut' module
   30REM LEN John TYTGAT, BASS/PiSoft 1991
   40:
   50MODE 0:OFF
   60*RMEnsure TimeOut 0.04 Error 0 Load the 'TimeOut' module first !
   70:
   80REM In case we made somewhere a BASIC error :
   90ON ERROR PROCserious_error
  100:
  110REM The following procedure shows the usage of the module 'TimeOut'.  It
  120REM does NOT corrupt the BASIC error handler !!!
  130:
  140PROCexample
  150PRINT "See this BASIC program for more info !"
  160END
  170:
  180:
  190DEFPROCexample
  200LOCAL ERROR
  210ON ERROR LOCAL RESTORE ERROR:IF ERR<>&30080 PROCserious_error ELSE PRINT REPORT$:ENDPROC
  220:
  230PRINT "Using the 'TimeOut' module we are going to draw some lines in"
  240PRINT "exactly 10 seconds. You can stop the program ealier by pressing a key."
  250PRINT "Press a key to continue..."
  260REPEAT:UNTIL GET:*FX 15
  270VDU 11:PRINT STRING$(26," ")
  280:
  290SYS "TimeOut_Duration",1000  :REM 10 seconds
  300SYS "TimeOut_String","Finished after exactly 10.00 seconds using the TimeOut module !"                 :REM TimeOut error string
  310
  320:
  330SYS "TimeOut_Start"  :REM TimeOut starts to count-down...
  340MOVE 100,100
  350REPEAT
  360  DRAW RND(1000)+100,RND(800)+100
  370UNTIL INKEY(0)<>-1   :REM This would only stop after pressing a key but wait 10 seconds...
  380SYS "TimeOut_Stop"   :REM Stop the TimeOut count-down ! There will be no longer any error from the TimeOut module.
  390PRINT "Program finished by user"
  400RESTORE ERROR
  410ENDPROC
  420:
  430DEFPROCserious_error
  440SYS "TimeOut_Stop"   :REM We have to stop 'TimeOut' count-down
  450PRINT "There was an error (not from the TimeOut module !) but '";REPORT$;"' at line ";ERL
  460END
  470ENDPROC

� >ExTimeOut
5� A small example concerning the 'TimeOut' module
%� � John TYTGAT, BASS/PiSoft 1991
(:
2	� 0:�
<D*RMEnsure TimeOut 0.04 Error 0 Load the 'TimeOut' module first !
F:
P/� In case we made somewhere a BASIC error :
Z� � �serious_error
d:
nJ� The following procedure shows the usage of the module 'TimeOut'.  It
x2� does NOT corrupt the BASIC error handler !!!
�:
��example
�.� "See this BASIC program for more info !"
��
�:
�:
�
��example
�� �
�1� � � � �:� �<>&30080 �serious_error � � �$:�
�:
�E� "Using the 'TimeOut' module we are going to draw some lines in"
�N� "exactly 10 seconds. You can stop the program ealier by pressing a key."
�"� "Press a key to continue..."
�:� �:*FX 15
� 11:� �26," ")
:
"-ș "TimeOut_Duration",1000  :� 10 seconds
,�ș "TimeOut_String","Finished after exactly 10.00 seconds using the TimeOut module !"                 :� TimeOut error string
6
@:
J:ș "TimeOut_Start"  :� TimeOut starts to count-down...
T
� 100,100
^�
h  � �(1000)+100,�(800)+100
rT� �(0)<>-1   :� This would only stop after pressing a key but wait 10 seconds...
|sș "TimeOut_Stop"   :� Stop the TimeOut count-down ! There will be no longer any error from the TimeOut module.
� � "Program finished by user"
�� �
��
�:
���serious_error
�?ș "TimeOut_Stop"   :� We have to stop 'TimeOut' count-down
�R� "There was an error (not from the TimeOut module !) but '";�$;"' at line ";�
��
��
�
00000000  0d 00 0a 10 f4 20 3e 45  78 54 69 6d 65 4f 75 74  |..... >ExTimeOut|
00000010  0d 00 14 35 f4 20 41 20  73 6d 61 6c 6c 20 65 78  |...5. A small ex|
00000020  61 6d 70 6c 65 20 63 6f  6e 63 65 72 6e 69 6e 67  |ample concerning|
00000030  20 74 68 65 20 27 54 69  6d 65 4f 75 74 27 20 6d  | the 'TimeOut' m|
00000040  6f 64 75 6c 65 0d 00 1e  25 f4 20 a9 20 4a 6f 68  |odule...%. . Joh|
00000050  6e 20 54 59 54 47 41 54  2c 20 42 41 53 53 2f 50  |n TYTGAT, BASS/P|
00000060  69 53 6f 66 74 20 31 39  39 31 0d 00 28 05 3a 0d  |iSoft 1991..(.:.|
00000070  00 32 09 eb 20 30 3a 87  0d 00 3c 44 2a 52 4d 45  |.2.. 0:...<D*RME|
00000080  6e 73 75 72 65 20 54 69  6d 65 4f 75 74 20 30 2e  |nsure TimeOut 0.|
00000090  30 34 20 45 72 72 6f 72  20 30 20 4c 6f 61 64 20  |04 Error 0 Load |
000000a0  74 68 65 20 27 54 69 6d  65 4f 75 74 27 20 6d 6f  |the 'TimeOut' mo|
000000b0  64 75 6c 65 20 66 69 72  73 74 20 21 0d 00 46 05  |dule first !..F.|
000000c0  3a 0d 00 50 2f f4 20 49  6e 20 63 61 73 65 20 77  |:..P/. In case w|
000000d0  65 20 6d 61 64 65 20 73  6f 6d 65 77 68 65 72 65  |e made somewhere|
000000e0  20 61 20 42 41 53 49 43  20 65 72 72 6f 72 20 3a  | a BASIC error :|
000000f0  0d 00 5a 16 ee 20 85 20  f2 73 65 72 69 6f 75 73  |..Z.. . .serious|
00000100  5f 65 72 72 6f 72 0d 00  64 05 3a 0d 00 6e 4a f4  |_error..d.:..nJ.|
00000110  20 54 68 65 20 66 6f 6c  6c 6f 77 69 6e 67 20 70  | The following p|
00000120  72 6f 63 65 64 75 72 65  20 73 68 6f 77 73 20 74  |rocedure shows t|
00000130  68 65 20 75 73 61 67 65  20 6f 66 20 74 68 65 20  |he usage of the |
00000140  6d 6f 64 75 6c 65 20 27  54 69 6d 65 4f 75 74 27  |module 'TimeOut'|
00000150  2e 20 20 49 74 0d 00 78  32 f4 20 64 6f 65 73 20  |.  It..x2. does |
00000160  4e 4f 54 20 63 6f 72 72  75 70 74 20 74 68 65 20  |NOT corrupt the |
00000170  42 41 53 49 43 20 65 72  72 6f 72 20 68 61 6e 64  |BASIC error hand|
00000180  6c 65 72 20 21 21 21 0d  00 82 05 3a 0d 00 8c 0c  |ler !!!....:....|
00000190  f2 65 78 61 6d 70 6c 65  0d 00 96 2e f1 20 22 53  |.example..... "S|
000001a0  65 65 20 74 68 69 73 20  42 41 53 49 43 20 70 72  |ee this BASIC pr|
000001b0  6f 67 72 61 6d 20 66 6f  72 20 6d 6f 72 65 20 69  |ogram for more i|
000001c0  6e 66 6f 20 21 22 0d 00  a0 05 e0 0d 00 aa 05 3a  |nfo !".........:|
000001d0  0d 00 b4 05 3a 0d 00 be  0d dd f2 65 78 61 6d 70  |....:......examp|
000001e0  6c 65 0d 00 c8 07 ea 20  85 0d 00 d2 31 ee 20 85  |le..... ....1. .|
000001f0  20 ea 20 f7 20 85 3a e7  20 9f 3c 3e 26 33 30 30  | . . .:. .<>&300|
00000200  38 30 20 f2 73 65 72 69  6f 75 73 5f 65 72 72 6f  |80 .serious_erro|
00000210  72 20 8b 20 f1 20 f6 24  3a e1 0d 00 dc 05 3a 0d  |r . . .$:.....:.|
00000220  00 e6 45 f1 20 22 55 73  69 6e 67 20 74 68 65 20  |..E. "Using the |
00000230  27 54 69 6d 65 4f 75 74  27 20 6d 6f 64 75 6c 65  |'TimeOut' module|
00000240  20 77 65 20 61 72 65 20  67 6f 69 6e 67 20 74 6f  | we are going to|
00000250  20 64 72 61 77 20 73 6f  6d 65 20 6c 69 6e 65 73  | draw some lines|
00000260  20 69 6e 22 0d 00 f0 4e  f1 20 22 65 78 61 63 74  | in"...N. "exact|
00000270  6c 79 20 31 30 20 73 65  63 6f 6e 64 73 2e 20 59  |ly 10 seconds. Y|
00000280  6f 75 20 63 61 6e 20 73  74 6f 70 20 74 68 65 20  |ou can stop the |
00000290  70 72 6f 67 72 61 6d 20  65 61 6c 69 65 72 20 62  |program ealier b|
000002a0  79 20 70 72 65 73 73 69  6e 67 20 61 20 6b 65 79  |y pressing a key|
000002b0  2e 22 0d 00 fa 22 f1 20  22 50 72 65 73 73 20 61  |."...". "Press a|
000002c0  20 6b 65 79 20 74 6f 20  63 6f 6e 74 69 6e 75 65  | key to continue|
000002d0  2e 2e 2e 22 0d 01 04 10  f5 3a fd 20 a5 3a 2a 46  |...".....:. .:*F|
000002e0  58 20 31 35 0d 01 0e 13  ef 20 31 31 3a f1 20 c4  |X 15..... 11:. .|
000002f0  32 36 2c 22 20 22 29 0d  01 18 05 3a 0d 01 22 2d  |26," ")....:.."-|
00000300  c8 99 20 22 54 69 6d 65  4f 75 74 5f 44 75 72 61  |.. "TimeOut_Dura|
00000310  74 69 6f 6e 22 2c 31 30  30 30 20 20 3a f4 20 31  |tion",1000  :. 1|
00000320  30 20 73 65 63 6f 6e 64  73 0d 01 2c 81 c8 99 20  |0 seconds..,... |
00000330  22 54 69 6d 65 4f 75 74  5f 53 74 72 69 6e 67 22  |"TimeOut_String"|
00000340  2c 22 46 69 6e 69 73 68  65 64 20 61 66 74 65 72  |,"Finished after|
00000350  20 65 78 61 63 74 6c 79  20 31 30 2e 30 30 20 73  | exactly 10.00 s|
00000360  65 63 6f 6e 64 73 20 75  73 69 6e 67 20 74 68 65  |econds using the|
00000370  20 54 69 6d 65 4f 75 74  20 6d 6f 64 75 6c 65 20  | TimeOut module |
00000380  21 22 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |!"              |
00000390  20 20 20 3a f4 20 54 69  6d 65 4f 75 74 20 65 72  |   :. TimeOut er|
000003a0  72 6f 72 20 73 74 72 69  6e 67 0d 01 36 04 0d 01  |ror string..6...|
000003b0  40 05 3a 0d 01 4a 3a c8  99 20 22 54 69 6d 65 4f  |@.:..J:.. "TimeO|
000003c0  75 74 5f 53 74 61 72 74  22 20 20 3a f4 20 54 69  |ut_Start"  :. Ti|
000003d0  6d 65 4f 75 74 20 73 74  61 72 74 73 20 74 6f 20  |meOut starts to |
000003e0  63 6f 75 6e 74 2d 64 6f  77 6e 2e 2e 2e 0d 01 54  |count-down.....T|
000003f0  0d ec 20 31 30 30 2c 31  30 30 0d 01 5e 05 f5 0d  |.. 100,100..^...|
00000400  01 68 1e 20 20 df 20 b3  28 31 30 30 30 29 2b 31  |.h.  . .(1000)+1|
00000410  30 30 2c b3 28 38 30 30  29 2b 31 30 30 0d 01 72  |00,.(800)+100..r|
00000420  54 fd 20 a6 28 30 29 3c  3e 2d 31 20 20 20 3a f4  |T. .(0)<>-1   :.|
00000430  20 54 68 69 73 20 77 6f  75 6c 64 20 6f 6e 6c 79  | This would only|
00000440  20 73 74 6f 70 20 61 66  74 65 72 20 70 72 65 73  | stop after pres|
00000450  73 69 6e 67 20 61 20 6b  65 79 20 62 75 74 20 77  |sing a key but w|
00000460  61 69 74 20 31 30 20 73  65 63 6f 6e 64 73 2e 2e  |ait 10 seconds..|
00000470  2e 0d 01 7c 73 c8 99 20  22 54 69 6d 65 4f 75 74  |...|s.. "TimeOut|
00000480  5f 53 74 6f 70 22 20 20  20 3a f4 20 53 74 6f 70  |_Stop"   :. Stop|
00000490  20 74 68 65 20 54 69 6d  65 4f 75 74 20 63 6f 75  | the TimeOut cou|
000004a0  6e 74 2d 64 6f 77 6e 20  21 20 54 68 65 72 65 20  |nt-down ! There |
000004b0  77 69 6c 6c 20 62 65 20  6e 6f 20 6c 6f 6e 67 65  |will be no longe|
000004c0  72 20 61 6e 79 20 65 72  72 6f 72 20 66 72 6f 6d  |r any error from|
000004d0  20 74 68 65 20 54 69 6d  65 4f 75 74 20 6d 6f 64  | the TimeOut mod|
000004e0  75 6c 65 2e 0d 01 86 20  f1 20 22 50 72 6f 67 72  |ule.... . "Progr|
000004f0  61 6d 20 66 69 6e 69 73  68 65 64 20 62 79 20 75  |am finished by u|
00000500  73 65 72 22 0d 01 90 07  f7 20 85 0d 01 9a 05 e1  |ser"..... ......|
00000510  0d 01 a4 05 3a 0d 01 ae  13 dd f2 73 65 72 69 6f  |....:......serio|
00000520  75 73 5f 65 72 72 6f 72  0d 01 b8 3f c8 99 20 22  |us_error...?.. "|
00000530  54 69 6d 65 4f 75 74 5f  53 74 6f 70 22 20 20 20  |TimeOut_Stop"   |
00000540  3a f4 20 57 65 20 68 61  76 65 20 74 6f 20 73 74  |:. We have to st|
00000550  6f 70 20 27 54 69 6d 65  4f 75 74 27 20 63 6f 75  |op 'TimeOut' cou|
00000560  6e 74 2d 64 6f 77 6e 0d  01 c2 52 f1 20 22 54 68  |nt-down...R. "Th|
00000570  65 72 65 20 77 61 73 20  61 6e 20 65 72 72 6f 72  |ere was an error|
00000580  20 28 6e 6f 74 20 66 72  6f 6d 20 74 68 65 20 54  | (not from the T|
00000590  69 6d 65 4f 75 74 20 6d  6f 64 75 6c 65 20 21 29  |imeOut module !)|
000005a0  20 62 75 74 20 27 22 3b  f6 24 3b 22 27 20 61 74  | but '";.$;"' at|
000005b0  20 6c 69 6e 65 20 22 3b  9e 0d 01 cc 05 e0 0d 01  | line ";........|
000005c0  d6 05 e1 0d ff                                    |.....|
000005c5