Home » Archimedes archive » Archimedes World » AW-1995-02-Disc1.adf » Disk1Feb95 » !AWFeb95/Goodies/BasicComp/!BC/Examples/LibHandler/LibHandler
!AWFeb95/Goodies/BasicComp/!BC/Examples/LibHandler/LibHandler
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 » Archimedes World » AW-1995-02-Disc1.adf » Disk1Feb95 |
Filename: | !AWFeb95/Goodies/BasicComp/!BC/Examples/LibHandler/LibHandler |
Read OK: | ✔ |
File size: | 15B4 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM >LibHandler 20 Example library file used to control the running of other libraries 30 And error handler 40 Note that error handler calls Wimp_CloseDown, and so non-wimp programs 50 may have to include a dummy version of this routine to keep 60 bascompress happy 70 : 80 USAGE: 90 This should be the first library file to be loaded, and its' 100 hard initialisation called. From then on just use _load_library. 110 120: 130DEF FN_LibHandler_version : = 013 140: 150DEF PROC_hard_initialise_LibHandler(max_libs%, need_version%) 160LOCAL ERROR 170 ON ERROR LOCAL RESTORE ERROR:PROC_e("%LibHandler: hard_initialise") 180 IF FN_LibHandler_version<need_version% THEN 190 ERROR 0, "LibHandler too old" 200 ENDIF 210 IF max_libs%<1 THEN 220 ERROR 0, "LibHandler: bad max librarys parameter" 230 ENDIF 240 max_library_files% = max_libs% 250 DIM library_names$(max_library_files%-1) 260 DIM library_versions%(max_library_files%-1) 270 num_library_files% = 0 280 : 290 : REM This is used so can indent nested error handlers. 300 : 310 Num_Lib_Error_Levels% = 40 320 Lib_Error_Level% = 0 330 On_Lib_Error_MODE% = 12 : REM A 16-colour screen. 340 On_Lib_Error_Continue% = FALSE 350 DIM Lib_Errors$(Num_Lib_Error_Levels%-1) 360 : 370 Wimp_Active% = FALSE 380 Debug_Wimp% = FALSE 390ENDPROC 400: 410REM ********************************************************************* 420REM * Load a library file, check it's a new enough version and then, if 430REM * it hasn't already been loaded, call its' hard initialisation. 440REM * This procedure could well be recursive. 450REM * IN: library$ == file name of library. 460REM * version% == earliest possible version required. 470REM * OUT: ERROR 0 if bad versions / too many library files. 480DEF PROC_load_library(library$, version%) 490LOCAL load%, i%, leaf$, e$ 500LOCAL ERROR 510 ON ERROR LOCAL RESTORE ERROR : PROC_e("%.LibHandler: load_library") 520 i% = 0 530 load% = TRUE 540 leaf$ = MID$(library$, 1 + INSTR(library$, ".")) 550 WHILE i%<num_library_files% AND load% 560 load% = (leaf$<>library_names$(i%)) 570 IF load% THEN 580 i% += 1 590 ENDIF 600 ENDWHILE 610 IF load% THEN 620 IF i%=max_library_files% THEN 630 ERROR 0,"LibHandler: Too many librarys to load!" 640 ENDIF 650 library_names$(i%) = leaf$ 660 LIBRARY library$ 670 e$ = "'" + library$ + "' does not have a FN_" 680 LOCAL ERROR 690 ON ERROR LOCAL RESTORE ERROR : PROC_e(e$ + leaf$ + "_version") 700 library_versions%(i%) = EVAL("FN_" + leaf$ + "_version") 710 RESTORE ERROR 720 num_library_files% += 1 730 REM This could be recursive. 740 LOCAL ERROR 750 ON ERROR LOCAL RESTORE ERROR : PROC_e(e$ + "_hard_initialise_" + leaf$) 760 IF EVAL("FN_hard_initialise_" + leaf$) THEN 770 ERROR 1, "Library file '" + library$ + "'s hard init'ion failed" 780 ENDIF 790 RESTORE ERROR 800 ENDIF 810 IF version%>library_versions%(i%) THEN 820 ERROR 1, "Library file '" + library$ + "' too old" 830 ENDIF 840ENDPROC 850: 860: 870REM ********************************************************************* 880REM * This is so can have error back-tracking, so can find out complete 890REM * calling hierarchy when an error occurs deep down - and this is how 900REM * to use it... 910REM * ON ERROR PROC_handle_library_error 920REM * ... 930REM * DEF PROC_my_proc(...) 940REM * LOCAL ... 950REM * LOCAL ERROR 960REM * ON ERROR LOCAL RESTORE ERROR : PROC_e("%.Lib: my_proc") 970REM * ... 980REM * ENDPROC 990REM * NB Need this other level, since if just keep 1000REM * 'ERROR ERR, routine$ + REPORT$', then BASIC will quickly have 1010REM * to chop the string to 255 characters. 1020REM * So storing in an array - then print out the error messages. 1030REM * 1040DEF PROC_e(routine$) 1050 IF Wimp_Active% THEN 1060 : REM Pass error onto next level of handler. 1070 : 1080 IF Debug_Wimp% THEN 1090 : REM Might be useful while debugging. 1100 : 1110 ERROR ERR, REPORT$+ " ["+ STR$ERL+ "]." 1120 ELSE 1130 ERROR ERR, REPORT$ 1140 ENDIF 1150 ELSE 1160 IF NOT On_Lib_Error_Continue% THEN 1170 IF Lib_Error_Level%=Num_Lib_Error_Levels% THEN 1180 Lib_Errors(Num_Lib_Error_Levels%-1) = "Errors too deep!!!!!" 1190 PROC_handle_library_error 1200 ENDIF 1210 IF RIGHT$(routine$, 2)=": " THEN 1220 routine$ = LEFT$(routine$, LEN(routine$)-2) 1230 ENDIF 1240 IF Debug_Wimp% THEN 1250 Lib_Errors$(Lib_Error_Level%) = REPORT$ 1260 ELSE 1270 IF Lib_Error_Level%=0 THEN 1280 Lib_Errors$(Lib_Error_Level%) = "Error `"+ REPORT$+ "' (line " 1290 Lib_Errors$(Lib_Error_Level%) += STR$(ERL) + ") in " 1300 Lib_Errors$(Lib_Error_Level%) += "`"+ routine$+ "'" 1310 ELSE 1320 Lib_Errors$(Lib_Error_Level%) = "`"+ routine$+ "'" 1330 ENDIF 1340 ENDIF 1350 Lib_Error_Level% += 1 1360 ERROR ERR, "" 1370 ENDIF 1380 ENDIF 1390ENDPROC 1400: 1410DEF PROC_handle_library_error 1420LOCAL iii%, eee$ 1430 IF Wimp_Active% THEN 1440 IF Debug_Wimp% THEN 1450 PROC_Wimp_Error(ERR, REPORT$+ " ["+ STR$(ERL)+ "].") 1460 PROC_Wimp_CloseDown 1470 END 1480 ELSE 1490 PROC_Wimp_Error(ERR, REPORT$) 1500 IF ERR=Wimp_Error_Fatal% THEN 1510 PROC_Wimp_CloseDown 1520 END 1530 ENDIF 1540 ENDIF 1550 ELSE 1560 IF On_Lib_Error_MODE%=-2 THEN 1570 IF Lib_Error_Level%>0 THEN 1580 ERROR EXT ERR, Lib_Errors$(0) 1590 ELSE 1600 ERROR EXT ERR, REPORT$ 1610 ENDIF 1620 END 1630 ENDIF 1640 IF On_Lib_Error_MODE%>=0 THEN 1650 MODE On_Lib_Error_MODE% : REM Reset screen. 1660 ENDIF 1670 PRINT "An error has occured..." 1680 PRINT 1690 IF Lib_Error_Level% THEN 1700 FOR iii%= 0 TO Lib_Error_Level%-1 1710 COLOUR ((7 - (iii% << 1)) AND 6) + 1 1720 PRINT Lib_Errors$(iii%); 1730 IF iii%<(Lib_Error_Level%-1) THEN 1740 PRINT " in "; 1750 ENDIF 1760 NEXT iii% 1770 ELSE 1780 PRINT REPORT$; " (line "; STR$(ERL); ")" 1790 ENDIF 1800 PRINT 1810 COLOUR 7 1820 END 1830 ENDIF 1840ENDPROC
� >LibHandler H Example library file used to control the running of other libraries And error handler (K Note that error handler calls Wimp_CloseDown, and so non-wimp programs 2@ may have to include a dummy version of this routine to keep < bascompress happy F : P USAGE: ZB This should be the first library file to be loaded, and its' dG hard initialisation called. From then on just use _load_library. n x: �$� �_LibHandler_version : = 013 �: �<� �_hard_initialise_LibHandler(max_libs%, need_version%) �� � �4 � � � � �:�_e("%LibHandler: hard_initialise") �- � �_LibHandler_version<need_version% � �# � 0, "LibHandler too old" � � � � max_libs%<1 � �7 � 0, "LibHandler: bad max librarys parameter" � � �% max_library_files% = max_libs% �- � library_names$(max_library_files%-1) 0 � library_versions%(max_library_files%-1) num_library_files% = 0 : "= : � This is used so can indent nested error handlers. , : 6" Num_Lib_Error_Levels% = 40 @! Lib_Error_Level% = 0 JE On_Lib_Error_MODE% = 12 : � A 16-colour screen. T! On_Lib_Error_Continue% = � ^- � Lib_Errors$(Num_Lib_Error_Levels%-1) h : r Wimp_Active% = � | Debug_Wimp% = � �� �: �K� ********************************************************************* �J� * Load a library file, check it's a new enough version and then, if �E� * it hasn't already been loaded, call its' hard initialisation. �/� * This procedure could well be recursive. �/� * IN: library$ == file name of library. �=� * version% == earliest possible version required. �?� * OUT: ERROR 0 if bad versions / too many library files. �(� �_load_library(library$, version%) �� load%, i%, leaf$, e$ �� � �4 � � � � � : �_e("%.LibHandler: load_library") i% = 0 load% = � . leaf$ = �library$, 1 + �library$, ".")) &' ȕ i%<num_library_files% � load% 0- load% = (leaf$<>library_names$(i%)) : � load% � D i% += 1 N � X � b � load% � l# � i%=max_library_files% � v9 � 0,"LibHandler: Too many librarys to load!" � � �$ library_names$(i%) = leaf$ � ț library$ �7 e$ = "'" + library$ + "' does not have a FN_" � � � �4 � � � � � : �_e(e$ + leaf$ + "_version") �? library_versions%(i%) = �("FN_" + leaf$ + "_version") � � � �& num_library_files% += 1 �% � This could be recursive. � � � �= � � � � � : �_e(e$ + "_hard_initialise_" + leaf$) �. � �("FN_hard_initialise_" + leaf$) � I � 1, "Library file '" + library$ + "'s hard init'ion failed" � � � � *) � version%>library_versions%(i%) � 48 � 1, "Library file '" + library$ + "' too old" > � H� R: \: fK� ********************************************************************* pI� * This is so can have error back-tracking, so can find out complete zJ� * calling hierarchy when an error occurs deep down - and this is how �� * to use it... �,� * ON ERROR PROC_handle_library_error � � * ... �� * DEF PROC_my_proc(...) �� * LOCAL ... �� * LOCAL ERROR �F� * ON ERROR LOCAL RESTORE ERROR : PROC_e("%.Lib: my_proc") �� * ... �� * ENDPROC �5� * NB Need this other level, since if just keep �I� * 'ERROR ERR, routine$ + REPORT$', then BASIC will quickly have �1� * to chop the string to 255 characters. �G� * So storing in an array - then print out the error messages. � * � �_e(routine$) � Wimp_Active% � $1 : � Pass error onto next level of handler. . : 8 � Debug_Wimp% � B- : � Might be useful while debugging. L : V! � �, �$+ " ["+ Þ+ "]." ` � j � �, �$ t � ~ � �$ � � On_Lib_Error_Continue% � �4 � Lib_Error_Level%=Num_Lib_Error_Levels% � �H Lib_Errors(Num_Lib_Error_Levels%-1) = "Errors too deep!!!!!" �" �_handle_library_error � � � � �routine$, 2)=": " � �0 routine$ = �routine$, �(routine$)-2) � � � � Debug_Wimp% � �. Lib_Errors$(Lib_Error_Level%) = �$ � � �" � Lib_Error_Level%=0 � G Lib_Errors$(Lib_Error_Level%) = "Error `"+ �$+ "' (line " = Lib_Errors$(Lib_Error_Level%) += �(�) + ") in " A Lib_Errors$(Lib_Error_Level%) += "`"+ routine$+ "'" � (@ Lib_Errors$(Lib_Error_Level%) = "`"+ routine$+ "'" 2 � < � F Lib_Error_Level% += 1 P � �, "" Z � d � n� x: �� �_handle_library_error �� iii%, eee$ � � Wimp_Active% � � � Debug_Wimp% � �/ �_Wimp_Error(�, �$+ " ["+ �(�)+ "].") � �_Wimp_CloseDown � � � � � �_Wimp_Error(�, �$) �! � �=Wimp_Error_Fatal% � � �_Wimp_CloseDown � � � � � � ! � On_Lib_Error_MODE%=-2 � " � Lib_Error_Level%>0 � ,! � � �, Lib_Errors$(0) 6 � @ � � �, �$ J � T � ^ � h! � On_Lib_Error_MODE%>=0 � r3 � On_Lib_Error_MODE% : � Reset screen. | � �# � "An error has occured..." � � � � Lib_Error_Level% � �( � iii%= 0 � Lib_Error_Level%-1 �) � ((7 - (iii% << 1)) � 6) + 1 � � Lib_Errors$(iii%); �) � iii%<(Lib_Error_Level%-1) � � � " in "; � � � � iii% � � �$ � �$; " (line "; �(�); ")" � � � � 7 � & � 0� �
00000000 0d 00 0a 12 f4 20 20 3e 4c 69 62 48 61 6e 64 6c |..... >LibHandl| 00000010 65 72 0d 00 14 48 20 45 78 61 6d 70 6c 65 20 6c |er...H Example l| 00000020 69 62 72 61 72 79 20 66 69 6c 65 20 75 73 65 64 |ibrary file used| 00000030 20 74 6f 20 63 6f 6e 74 72 6f 6c 20 74 68 65 20 | to control the | 00000040 72 75 6e 6e 69 6e 67 20 6f 66 20 6f 74 68 65 72 |running of other| 00000050 20 6c 69 62 72 61 72 69 65 73 0d 00 1e 16 20 41 | libraries.... A| 00000060 6e 64 20 65 72 72 6f 72 20 68 61 6e 64 6c 65 72 |nd error handler| 00000070 0d 00 28 4b 20 4e 6f 74 65 20 74 68 61 74 20 65 |..(K Note that e| 00000080 72 72 6f 72 20 68 61 6e 64 6c 65 72 20 63 61 6c |rror handler cal| 00000090 6c 73 20 57 69 6d 70 5f 43 6c 6f 73 65 44 6f 77 |ls Wimp_CloseDow| 000000a0 6e 2c 20 61 6e 64 20 73 6f 20 6e 6f 6e 2d 77 69 |n, and so non-wi| 000000b0 6d 70 20 70 72 6f 67 72 61 6d 73 0d 00 32 40 20 |mp programs..2@ | 000000c0 6d 61 79 20 68 61 76 65 20 74 6f 20 69 6e 63 6c |may have to incl| 000000d0 75 64 65 20 61 20 64 75 6d 6d 79 20 76 65 72 73 |ude a dummy vers| 000000e0 69 6f 6e 20 6f 66 20 74 68 69 73 20 72 6f 75 74 |ion of this rout| 000000f0 69 6e 65 20 74 6f 20 6b 65 65 70 0d 00 3c 16 20 |ine to keep..<. | 00000100 62 61 73 63 6f 6d 70 72 65 73 73 20 68 61 70 70 |bascompress happ| 00000110 79 0d 00 46 06 20 3a 0d 00 50 0b 20 55 53 41 47 |y..F. :..P. USAG| 00000120 45 3a 0d 00 5a 42 20 20 54 68 69 73 20 73 68 6f |E:..ZB This sho| 00000130 75 6c 64 20 62 65 20 74 68 65 20 66 69 72 73 74 |uld be the first| 00000140 20 6c 69 62 72 61 72 79 20 66 69 6c 65 20 74 6f | library file to| 00000150 20 62 65 20 6c 6f 61 64 65 64 2c 20 61 6e 64 20 | be loaded, and | 00000160 69 74 73 27 0d 00 64 47 20 20 68 61 72 64 20 69 |its'..dG hard i| 00000170 6e 69 74 69 61 6c 69 73 61 74 69 6f 6e 20 63 61 |nitialisation ca| 00000180 6c 6c 65 64 2e 20 20 46 72 6f 6d 20 74 68 65 6e |lled. From then| 00000190 20 6f 6e 20 6a 75 73 74 20 75 73 65 20 5f 6c 6f | on just use _lo| 000001a0 61 64 5f 6c 69 62 72 61 72 79 2e 0d 00 6e 04 0d |ad_library...n..| 000001b0 00 78 05 3a 0d 00 82 24 dd 20 a4 5f 4c 69 62 48 |.x.:...$. ._LibH| 000001c0 61 6e 64 6c 65 72 5f 76 65 72 73 69 6f 6e 20 20 |andler_version | 000001d0 3a 20 20 3d 20 30 31 33 0d 00 8c 05 3a 0d 00 96 |: = 013....:...| 000001e0 3c dd 20 f2 5f 68 61 72 64 5f 69 6e 69 74 69 61 |<. ._hard_initia| 000001f0 6c 69 73 65 5f 4c 69 62 48 61 6e 64 6c 65 72 28 |lise_LibHandler(| 00000200 6d 61 78 5f 6c 69 62 73 25 2c 20 6e 65 65 64 5f |max_libs%, need_| 00000210 76 65 72 73 69 6f 6e 25 29 0d 00 a0 07 ea 20 85 |version%)..... .| 00000220 0d 00 aa 34 20 20 20 ee 20 85 20 ea 20 f7 20 85 |...4 . . . . .| 00000230 3a f2 5f 65 28 22 25 4c 69 62 48 61 6e 64 6c 65 |:._e("%LibHandle| 00000240 72 3a 20 68 61 72 64 5f 69 6e 69 74 69 61 6c 69 |r: hard_initiali| 00000250 73 65 22 29 0d 00 b4 2d 20 20 20 e7 20 a4 5f 4c |se")...- . ._L| 00000260 69 62 48 61 6e 64 6c 65 72 5f 76 65 72 73 69 6f |ibHandler_versio| 00000270 6e 3c 6e 65 65 64 5f 76 65 72 73 69 6f 6e 25 20 |n<need_version% | 00000280 8c 0d 00 be 23 20 20 20 20 20 20 85 20 30 2c 20 |....# . 0, | 00000290 22 4c 69 62 48 61 6e 64 6c 65 72 20 74 6f 6f 20 |"LibHandler too | 000002a0 6f 6c 64 22 0d 00 c8 08 20 20 20 cd 0d 00 d2 16 |old".... .....| 000002b0 20 20 20 e7 20 6d 61 78 5f 6c 69 62 73 25 3c 31 | . max_libs%<1| 000002c0 20 8c 0d 00 dc 37 20 20 20 20 20 20 85 20 30 2c | ....7 . 0,| 000002d0 20 22 4c 69 62 48 61 6e 64 6c 65 72 3a 20 62 61 | "LibHandler: ba| 000002e0 64 20 6d 61 78 20 6c 69 62 72 61 72 79 73 20 70 |d max librarys p| 000002f0 61 72 61 6d 65 74 65 72 22 0d 00 e6 08 20 20 20 |arameter".... | 00000300 cd 0d 00 f0 25 20 20 20 6d 61 78 5f 6c 69 62 72 |....% max_libr| 00000310 61 72 79 5f 66 69 6c 65 73 25 20 3d 20 6d 61 78 |ary_files% = max| 00000320 5f 6c 69 62 73 25 0d 00 fa 2d 20 20 20 de 20 6c |_libs%...- . l| 00000330 69 62 72 61 72 79 5f 6e 61 6d 65 73 24 28 6d 61 |ibrary_names$(ma| 00000340 78 5f 6c 69 62 72 61 72 79 5f 66 69 6c 65 73 25 |x_library_files%| 00000350 2d 31 29 0d 01 04 30 20 20 20 de 20 6c 69 62 72 |-1)...0 . libr| 00000360 61 72 79 5f 76 65 72 73 69 6f 6e 73 25 28 6d 61 |ary_versions%(ma| 00000370 78 5f 6c 69 62 72 61 72 79 5f 66 69 6c 65 73 25 |x_library_files%| 00000380 2d 31 29 0d 01 0e 1d 20 20 20 6e 75 6d 5f 6c 69 |-1).... num_li| 00000390 62 72 61 72 79 5f 66 69 6c 65 73 25 20 3d 20 30 |brary_files% = 0| 000003a0 0d 01 18 08 20 20 20 3a 0d 01 22 3d 20 20 20 3a |.... :.."= :| 000003b0 20 f4 20 20 54 68 69 73 20 69 73 20 75 73 65 64 | . This is used| 000003c0 20 73 6f 20 63 61 6e 20 69 6e 64 65 6e 74 20 6e | so can indent n| 000003d0 65 73 74 65 64 20 65 72 72 6f 72 20 68 61 6e 64 |ested error hand| 000003e0 6c 65 72 73 2e 0d 01 2c 08 20 20 20 3a 0d 01 36 |lers...,. :..6| 000003f0 22 20 20 20 4e 75 6d 5f 4c 69 62 5f 45 72 72 6f |" Num_Lib_Erro| 00000400 72 5f 4c 65 76 65 6c 73 25 20 20 3d 20 34 30 0d |r_Levels% = 40.| 00000410 01 40 21 20 20 20 4c 69 62 5f 45 72 72 6f 72 5f |.@! Lib_Error_| 00000420 4c 65 76 65 6c 25 20 20 20 20 20 20 20 3d 20 30 |Level% = 0| 00000430 0d 01 4a 45 20 20 20 4f 6e 5f 4c 69 62 5f 45 72 |..JE On_Lib_Er| 00000440 72 6f 72 5f 4d 4f 44 45 25 20 20 20 20 20 3d 20 |ror_MODE% = | 00000450 31 32 20 20 20 20 20 20 20 20 20 20 3a 20 20 f4 |12 : .| 00000460 20 20 41 20 31 36 2d 63 6f 6c 6f 75 72 20 73 63 | A 16-colour sc| 00000470 72 65 65 6e 2e 0d 01 54 21 20 20 20 4f 6e 5f 4c |reen...T! On_L| 00000480 69 62 5f 45 72 72 6f 72 5f 43 6f 6e 74 69 6e 75 |ib_Error_Continu| 00000490 65 25 20 3d 20 a3 0d 01 5e 2d 20 20 20 de 20 4c |e% = ...^- . L| 000004a0 69 62 5f 45 72 72 6f 72 73 24 28 4e 75 6d 5f 4c |ib_Errors$(Num_L| 000004b0 69 62 5f 45 72 72 6f 72 5f 4c 65 76 65 6c 73 25 |ib_Error_Levels%| 000004c0 2d 31 29 0d 01 68 08 20 20 20 3a 0d 01 72 17 20 |-1)..h. :..r. | 000004d0 20 20 57 69 6d 70 5f 41 63 74 69 76 65 25 20 3d | Wimp_Active% =| 000004e0 20 a3 0d 01 7c 17 20 20 20 44 65 62 75 67 5f 57 | ...|. Debug_W| 000004f0 69 6d 70 25 20 20 3d 20 a3 0d 01 86 05 e1 0d 01 |imp% = ........| 00000500 90 05 3a 0d 01 9a 4b f4 20 2a 2a 2a 2a 2a 2a 2a |..:...K. *******| 00000510 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 00000540 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 0d 01 |**************..| 00000550 a4 4a f4 20 2a 20 4c 6f 61 64 20 61 20 6c 69 62 |.J. * Load a lib| 00000560 72 61 72 79 20 66 69 6c 65 2c 20 63 68 65 63 6b |rary file, check| 00000570 20 69 74 27 73 20 61 20 6e 65 77 20 65 6e 6f 75 | it's a new enou| 00000580 67 68 20 76 65 72 73 69 6f 6e 20 20 61 6e 64 20 |gh version and | 00000590 74 68 65 6e 2c 20 69 66 0d 01 ae 45 f4 20 2a 20 |then, if...E. * | 000005a0 69 74 20 68 61 73 6e 27 74 20 61 6c 72 65 61 64 |it hasn't alread| 000005b0 79 20 62 65 65 6e 20 6c 6f 61 64 65 64 2c 20 63 |y been loaded, c| 000005c0 61 6c 6c 20 69 74 73 27 20 68 61 72 64 20 69 6e |all its' hard in| 000005d0 69 74 69 61 6c 69 73 61 74 69 6f 6e 2e 0d 01 b8 |itialisation....| 000005e0 2f f4 20 2a 20 54 68 69 73 20 70 72 6f 63 65 64 |/. * This proced| 000005f0 75 72 65 20 63 6f 75 6c 64 20 77 65 6c 6c 20 62 |ure could well b| 00000600 65 20 72 65 63 75 72 73 69 76 65 2e 0d 01 c2 2f |e recursive..../| 00000610 f4 20 2a 20 49 4e 3a 20 20 20 6c 69 62 72 61 72 |. * IN: librar| 00000620 79 24 20 3d 3d 20 66 69 6c 65 20 6e 61 6d 65 20 |y$ == file name | 00000630 6f 66 20 6c 69 62 72 61 72 79 2e 0d 01 cc 3d f4 |of library....=.| 00000640 20 2a 20 20 20 20 20 20 20 76 65 72 73 69 6f 6e | * version| 00000650 25 20 3d 3d 20 65 61 72 6c 69 65 73 74 20 70 6f |% == earliest po| 00000660 73 73 69 62 6c 65 20 76 65 72 73 69 6f 6e 20 72 |ssible version r| 00000670 65 71 75 69 72 65 64 2e 0d 01 d6 3f f4 20 2a 20 |equired....?. * | 00000680 4f 55 54 3a 20 20 45 52 52 4f 52 20 30 20 69 66 |OUT: ERROR 0 if| 00000690 20 62 61 64 20 76 65 72 73 69 6f 6e 73 20 2f 20 | bad versions / | 000006a0 74 6f 6f 20 6d 61 6e 79 20 6c 69 62 72 61 72 79 |too many library| 000006b0 20 66 69 6c 65 73 2e 0d 01 e0 28 dd 20 f2 5f 6c | files....(. ._l| 000006c0 6f 61 64 5f 6c 69 62 72 61 72 79 28 6c 69 62 72 |oad_library(libr| 000006d0 61 72 79 24 2c 20 76 65 72 73 69 6f 6e 25 29 0d |ary$, version%).| 000006e0 01 ea 1a ea 20 6c 6f 61 64 25 2c 20 69 25 2c 20 |.... load%, i%, | 000006f0 6c 65 61 66 24 2c 20 65 24 0d 01 f4 07 ea 20 85 |leaf$, e$..... .| 00000700 0d 01 fe 34 20 20 20 ee 20 85 20 ea 20 f7 20 85 |...4 . . . . .| 00000710 20 3a 20 f2 5f 65 28 22 25 2e 4c 69 62 48 61 6e | : ._e("%.LibHan| 00000720 64 6c 65 72 3a 20 6c 6f 61 64 5f 6c 69 62 72 61 |dler: load_libra| 00000730 72 79 22 29 0d 02 08 10 20 20 20 69 25 20 20 20 |ry").... i% | 00000740 20 3d 20 30 0d 02 12 10 20 20 20 6c 6f 61 64 25 | = 0.... load%| 00000750 20 3d 20 b9 0d 02 1c 2e 20 20 20 6c 65 61 66 24 | = ..... leaf$| 00000760 20 3d 20 c1 6c 69 62 72 61 72 79 24 2c 20 31 20 | = .library$, 1 | 00000770 2b 20 a7 6c 69 62 72 61 72 79 24 2c 20 22 2e 22 |+ .library$, "."| 00000780 29 29 0d 02 26 27 20 20 20 c8 95 20 69 25 3c 6e |))..&' .. i%<n| 00000790 75 6d 5f 6c 69 62 72 61 72 79 5f 66 69 6c 65 73 |um_library_files| 000007a0 25 20 80 20 6c 6f 61 64 25 0d 02 30 2d 20 20 20 |% . load%..0- | 000007b0 20 20 20 6c 6f 61 64 25 20 3d 20 28 6c 65 61 66 | load% = (leaf| 000007c0 24 3c 3e 6c 69 62 72 61 72 79 5f 6e 61 6d 65 73 |$<>library_names| 000007d0 24 28 69 25 29 29 0d 02 3a 13 20 20 20 20 20 20 |$(i%))..:. | 000007e0 e7 20 6c 6f 61 64 25 20 8c 0d 02 44 14 20 20 20 |. load% ...D. | 000007f0 20 20 20 20 20 20 69 25 20 2b 3d 20 31 0d 02 4e | i% += 1..N| 00000800 0b 20 20 20 20 20 20 cd 0d 02 58 08 20 20 20 ce |. ...X. .| 00000810 0d 02 62 10 20 20 20 e7 20 6c 6f 61 64 25 20 8c |..b. . load% .| 00000820 0d 02 6c 23 20 20 20 20 20 20 e7 20 69 25 3d 6d |..l# . i%=m| 00000830 61 78 5f 6c 69 62 72 61 72 79 5f 66 69 6c 65 73 |ax_library_files| 00000840 25 20 8c 0d 02 76 39 20 20 20 20 20 20 20 20 20 |% ...v9 | 00000850 85 20 30 2c 22 4c 69 62 48 61 6e 64 6c 65 72 3a |. 0,"LibHandler:| 00000860 20 54 6f 6f 20 6d 61 6e 79 20 6c 69 62 72 61 72 | Too many librar| 00000870 79 73 20 74 6f 20 6c 6f 61 64 21 22 0d 02 80 0b |ys to load!"....| 00000880 20 20 20 20 20 20 cd 0d 02 8a 24 20 20 20 20 20 | ....$ | 00000890 20 6c 69 62 72 61 72 79 5f 6e 61 6d 65 73 24 28 | library_names$(| 000008a0 69 25 29 20 3d 20 6c 65 61 66 24 0d 02 94 15 20 |i%) = leaf$.... | 000008b0 20 20 20 20 20 c8 9b 20 6c 69 62 72 61 72 79 24 | .. library$| 000008c0 0d 02 9e 37 20 20 20 20 20 20 65 24 20 3d 20 22 |...7 e$ = "| 000008d0 27 22 20 2b 20 6c 69 62 72 61 72 79 24 20 2b 20 |'" + library$ + | 000008e0 22 27 20 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 |"' does not have| 000008f0 20 61 20 46 4e 5f 22 0d 02 a8 0d 20 20 20 20 20 | a FN_".... | 00000900 20 ea 20 85 0d 02 b2 34 20 20 20 20 20 20 ee 20 | . ....4 . | 00000910 85 20 ea 20 f7 20 85 20 20 3a 20 20 f2 5f 65 28 |. . . . : ._e(| 00000920 65 24 20 2b 20 6c 65 61 66 24 20 2b 20 22 5f 76 |e$ + leaf$ + "_v| 00000930 65 72 73 69 6f 6e 22 29 0d 02 bc 3f 20 20 20 20 |ersion")...? | 00000940 20 20 6c 69 62 72 61 72 79 5f 76 65 72 73 69 6f | library_versio| 00000950 6e 73 25 28 69 25 29 20 3d 20 a0 28 22 46 4e 5f |ns%(i%) = .("FN_| 00000960 22 20 2b 20 6c 65 61 66 24 20 2b 20 22 5f 76 65 |" + leaf$ + "_ve| 00000970 72 73 69 6f 6e 22 29 0d 02 c6 0d 20 20 20 20 20 |rsion").... | 00000980 20 f7 20 85 0d 02 d0 26 20 20 20 20 20 20 6e 75 | . ....& nu| 00000990 6d 5f 6c 69 62 72 61 72 79 5f 66 69 6c 65 73 25 |m_library_files%| 000009a0 20 20 20 20 20 20 2b 3d 20 31 0d 02 da 25 20 20 | += 1...% | 000009b0 20 20 20 20 f4 20 20 54 68 69 73 20 63 6f 75 6c | . This coul| 000009c0 64 20 62 65 20 72 65 63 75 72 73 69 76 65 2e 0d |d be recursive..| 000009d0 02 e4 0d 20 20 20 20 20 20 ea 20 85 0d 02 ee 3d |... . ....=| 000009e0 20 20 20 20 20 20 ee 20 85 20 ea 20 f7 20 85 20 | . . . . . | 000009f0 20 3a 20 20 f2 5f 65 28 65 24 20 2b 20 22 5f 68 | : ._e(e$ + "_h| 00000a00 61 72 64 5f 69 6e 69 74 69 61 6c 69 73 65 5f 22 |ard_initialise_"| 00000a10 20 2b 20 6c 65 61 66 24 29 0d 02 f8 2e 20 20 20 | + leaf$).... | 00000a20 20 20 20 e7 20 a0 28 22 46 4e 5f 68 61 72 64 5f | . .("FN_hard_| 00000a30 69 6e 69 74 69 61 6c 69 73 65 5f 22 20 2b 20 6c |initialise_" + l| 00000a40 65 61 66 24 29 20 8c 0d 03 02 49 20 20 20 20 20 |eaf$) ....I | 00000a50 20 20 20 20 85 20 31 2c 20 22 4c 69 62 72 61 72 | . 1, "Librar| 00000a60 79 20 66 69 6c 65 20 27 22 20 2b 20 6c 69 62 72 |y file '" + libr| 00000a70 61 72 79 24 20 2b 20 22 27 73 20 68 61 72 64 20 |ary$ + "'s hard | 00000a80 69 6e 69 74 27 69 6f 6e 20 66 61 69 6c 65 64 22 |init'ion failed"| 00000a90 0d 03 0c 0b 20 20 20 20 20 20 cd 0d 03 16 0d 20 |.... ..... | 00000aa0 20 20 20 20 20 f7 20 85 0d 03 20 08 20 20 20 cd | . ... . .| 00000ab0 0d 03 2a 29 20 20 20 e7 20 76 65 72 73 69 6f 6e |..*) . version| 00000ac0 25 3e 6c 69 62 72 61 72 79 5f 76 65 72 73 69 6f |%>library_versio| 00000ad0 6e 73 25 28 69 25 29 20 8c 0d 03 34 38 20 20 20 |ns%(i%) ...48 | 00000ae0 20 20 20 85 20 31 2c 20 22 4c 69 62 72 61 72 79 | . 1, "Library| 00000af0 20 66 69 6c 65 20 27 22 20 2b 20 6c 69 62 72 61 | file '" + libra| 00000b00 72 79 24 20 2b 20 22 27 20 74 6f 6f 20 6f 6c 64 |ry$ + "' too old| 00000b10 22 0d 03 3e 08 20 20 20 cd 0d 03 48 05 e1 0d 03 |"..>. ...H....| 00000b20 52 05 3a 0d 03 5c 05 3a 0d 03 66 4b f4 20 2a 2a |R.:..\.:..fK. **| 00000b30 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a |****************| * 00000b70 2a 2a 2a 0d 03 70 49 f4 20 2a 20 54 68 69 73 20 |***..pI. * This | 00000b80 69 73 20 73 6f 20 63 61 6e 20 68 61 76 65 20 65 |is so can have e| 00000b90 72 72 6f 72 20 62 61 63 6b 2d 74 72 61 63 6b 69 |rror back-tracki| 00000ba0 6e 67 2c 20 73 6f 20 63 61 6e 20 66 69 6e 64 20 |ng, so can find | 00000bb0 6f 75 74 20 63 6f 6d 70 6c 65 74 65 0d 03 7a 4a |out complete..zJ| 00000bc0 f4 20 2a 20 63 61 6c 6c 69 6e 67 20 68 69 65 72 |. * calling hier| 00000bd0 61 72 63 68 79 20 77 68 65 6e 20 61 6e 20 65 72 |archy when an er| 00000be0 72 6f 72 20 6f 63 63 75 72 73 20 64 65 65 70 20 |ror occurs deep | 00000bf0 64 6f 77 6e 20 2d 20 61 6e 64 20 74 68 69 73 20 |down - and this | 00000c00 69 73 20 68 6f 77 0d 03 84 14 f4 20 2a 20 74 6f |is how..... * to| 00000c10 20 75 73 65 20 69 74 2e 2e 2e 0d 03 8e 2c f4 20 | use it......,. | 00000c20 2a 20 20 20 4f 4e 20 45 52 52 4f 52 20 50 52 4f |* ON ERROR PRO| 00000c30 43 5f 68 61 6e 64 6c 65 5f 6c 69 62 72 61 72 79 |C_handle_library| 00000c40 5f 65 72 72 6f 72 0d 03 98 0d f4 20 2a 20 20 20 |_error..... * | 00000c50 2e 2e 2e 0d 03 a2 1f f4 20 2a 20 20 20 44 45 46 |........ * DEF| 00000c60 20 50 52 4f 43 5f 6d 79 5f 70 72 6f 63 28 2e 2e | PROC_my_proc(..| 00000c70 2e 29 0d 03 ac 13 f4 20 2a 20 20 20 4c 4f 43 41 |.)..... * LOCA| 00000c80 4c 20 2e 2e 2e 0d 03 b6 15 f4 20 2a 20 20 20 4c |L ........ * L| 00000c90 4f 43 41 4c 20 45 52 52 4f 52 0d 03 c0 46 f4 20 |OCAL ERROR...F. | 00000ca0 2a 20 20 20 20 20 20 4f 4e 20 45 52 52 4f 52 20 |* ON ERROR | 00000cb0 4c 4f 43 41 4c 20 52 45 53 54 4f 52 45 20 45 52 |LOCAL RESTORE ER| 00000cc0 52 4f 52 20 20 3a 20 20 50 52 4f 43 5f 65 28 22 |ROR : PROC_e("| 00000cd0 25 2e 4c 69 62 3a 20 6d 79 5f 70 72 6f 63 22 29 |%.Lib: my_proc")| 00000ce0 0d 03 ca 10 f4 20 2a 20 20 20 20 20 20 2e 2e 2e |..... * ...| 00000cf0 0d 03 d4 11 f4 20 2a 20 20 20 45 4e 44 50 52 4f |..... * ENDPRO| 00000d00 43 0d 03 de 35 f4 20 2a 20 4e 42 20 20 4e 65 65 |C...5. * NB Nee| 00000d10 64 20 74 68 69 73 20 6f 74 68 65 72 20 6c 65 76 |d this other lev| 00000d20 65 6c 2c 20 73 69 6e 63 65 20 69 66 20 6a 75 73 |el, since if jus| 00000d30 74 20 6b 65 65 70 0d 03 e8 49 f4 20 2a 20 20 20 |t keep...I. * | 00000d40 20 20 27 45 52 52 4f 52 20 45 52 52 2c 20 72 6f | 'ERROR ERR, ro| 00000d50 75 74 69 6e 65 24 20 2b 20 52 45 50 4f 52 54 24 |utine$ + REPORT$| 00000d60 27 2c 20 74 68 65 6e 20 42 41 53 49 43 20 77 69 |', then BASIC wi| 00000d70 6c 6c 20 71 75 69 63 6b 6c 79 20 68 61 76 65 0d |ll quickly have.| 00000d80 03 f2 31 f4 20 2a 20 20 20 20 20 74 6f 20 63 68 |..1. * to ch| 00000d90 6f 70 20 74 68 65 20 73 74 72 69 6e 67 20 74 6f |op the string to| 00000da0 20 32 35 35 20 63 68 61 72 61 63 74 65 72 73 2e | 255 characters.| 00000db0 0d 03 fc 47 f4 20 2a 20 20 20 20 20 53 6f 20 73 |...G. * So s| 00000dc0 74 6f 72 69 6e 67 20 69 6e 20 61 6e 20 61 72 72 |toring in an arr| 00000dd0 61 79 20 2d 20 74 68 65 6e 20 70 72 69 6e 74 20 |ay - then print | 00000de0 6f 75 74 20 74 68 65 20 65 72 72 6f 72 20 6d 65 |out the error me| 00000df0 73 73 61 67 65 73 2e 0d 04 06 07 f4 20 2a 0d 04 |ssages...... *..| 00000e00 10 13 dd 20 f2 5f 65 28 72 6f 75 74 69 6e 65 24 |... ._e(routine$| 00000e10 29 0d 04 1a 16 20 20 e7 20 57 69 6d 70 5f 41 63 |).... . Wimp_Ac| 00000e20 74 69 76 65 25 20 8c 0d 04 24 31 20 20 3a 20 f4 |tive% ...$1 : .| 00000e30 20 20 50 61 73 73 20 65 72 72 6f 72 20 6f 6e 74 | Pass error ont| 00000e40 6f 20 6e 65 78 74 20 6c 65 76 65 6c 20 6f 66 20 |o next level of | 00000e50 68 61 6e 64 6c 65 72 2e 0d 04 2e 07 20 20 3a 0d |handler..... :.| 00000e60 04 38 17 20 20 20 20 e7 20 44 65 62 75 67 5f 57 |.8. . Debug_W| 00000e70 69 6d 70 25 20 8c 0d 04 42 2d 20 20 20 20 3a 20 |imp% ...B- : | 00000e80 f4 20 20 4d 69 67 68 74 20 62 65 20 75 73 65 66 |. Might be usef| 00000e90 75 6c 20 77 68 69 6c 65 20 64 65 62 75 67 67 69 |ul while debuggi| 00000ea0 6e 67 2e 0d 04 4c 09 20 20 20 20 3a 0d 04 56 21 |ng...L. :..V!| 00000eb0 20 20 20 20 20 20 85 20 9f 2c 20 f6 24 2b 20 22 | . ., .$+ "| 00000ec0 20 5b 22 2b 20 c3 9e 2b 20 22 5d 2e 22 0d 04 60 | ["+ ..+ "]."..`| 00000ed0 09 20 20 20 20 cc 0d 04 6a 11 20 20 20 20 20 20 |. ...j. | 00000ee0 85 20 9f 2c 20 f6 24 0d 04 74 09 20 20 20 20 cd |. ., .$..t. .| 00000ef0 0d 04 7e 07 20 20 cc 0d 04 88 24 20 20 20 20 e7 |..~. ....$ .| 00000f00 20 ac 20 4f 6e 5f 4c 69 62 5f 45 72 72 6f 72 5f | . On_Lib_Error_| 00000f10 43 6f 6e 74 69 6e 75 65 25 20 8c 0d 04 92 34 20 |Continue% ....4 | 00000f20 20 20 20 20 20 e7 20 4c 69 62 5f 45 72 72 6f 72 | . Lib_Error| 00000f30 5f 4c 65 76 65 6c 25 3d 4e 75 6d 5f 4c 69 62 5f |_Level%=Num_Lib_| 00000f40 45 72 72 6f 72 5f 4c 65 76 65 6c 73 25 20 8c 0d |Error_Levels% ..| 00000f50 04 9c 48 20 20 20 20 20 20 20 20 4c 69 62 5f 45 |..H Lib_E| 00000f60 72 72 6f 72 73 28 4e 75 6d 5f 4c 69 62 5f 45 72 |rrors(Num_Lib_Er| 00000f70 72 6f 72 5f 4c 65 76 65 6c 73 25 2d 31 29 20 3d |ror_Levels%-1) =| 00000f80 20 22 45 72 72 6f 72 73 20 74 6f 6f 20 64 65 65 | "Errors too dee| 00000f90 70 21 21 21 21 21 22 0d 04 a6 22 20 20 20 20 20 |p!!!!!"..." | 00000fa0 20 20 20 f2 5f 68 61 6e 64 6c 65 5f 6c 69 62 72 | ._handle_libr| 00000fb0 61 72 79 5f 65 72 72 6f 72 0d 04 b0 0b 20 20 20 |ary_error.... | 00000fc0 20 20 20 cd 0d 04 ba 20 20 20 20 20 20 20 e7 20 | .... . | 00000fd0 c2 72 6f 75 74 69 6e 65 24 2c 20 32 29 3d 22 3a |.routine$, 2)=":| 00000fe0 20 22 20 8c 0d 04 c4 30 20 20 20 20 20 20 20 20 | " ....0 | 00000ff0 72 6f 75 74 69 6e 65 24 20 3d 20 c0 72 6f 75 74 |routine$ = .rout| 00001000 69 6e 65 24 2c 20 a9 28 72 6f 75 74 69 6e 65 24 |ine$, .(routine$| 00001010 29 2d 32 29 0d 04 ce 0b 20 20 20 20 20 20 cd 0d |)-2).... ..| 00001020 04 d8 19 20 20 20 20 20 20 e7 20 44 65 62 75 67 |... . Debug| 00001030 5f 57 69 6d 70 25 20 8c 0d 04 e2 2e 20 20 20 20 |_Wimp% ..... | 00001040 20 20 20 20 4c 69 62 5f 45 72 72 6f 72 73 24 28 | Lib_Errors$(| 00001050 4c 69 62 5f 45 72 72 6f 72 5f 4c 65 76 65 6c 25 |Lib_Error_Level%| 00001060 29 20 3d 20 f6 24 0d 04 ec 0b 20 20 20 20 20 20 |) = .$.... | 00001070 cc 0d 04 f6 22 20 20 20 20 20 20 20 20 e7 20 4c |...." . L| 00001080 69 62 5f 45 72 72 6f 72 5f 4c 65 76 65 6c 25 3d |ib_Error_Level%=| 00001090 30 20 8c 0d 05 00 47 20 20 20 20 20 20 20 20 20 |0 ....G | 000010a0 20 4c 69 62 5f 45 72 72 6f 72 73 24 28 4c 69 62 | Lib_Errors$(Lib| 000010b0 5f 45 72 72 6f 72 5f 4c 65 76 65 6c 25 29 20 3d |_Error_Level%) =| 000010c0 20 22 45 72 72 6f 72 20 60 22 2b 20 f6 24 2b 20 | "Error `"+ .$+ | 000010d0 22 27 20 28 6c 69 6e 65 20 22 0d 05 0a 3d 20 20 |"' (line "...= | 000010e0 20 20 20 20 20 20 20 20 4c 69 62 5f 45 72 72 6f | Lib_Erro| 000010f0 72 73 24 28 4c 69 62 5f 45 72 72 6f 72 5f 4c 65 |rs$(Lib_Error_Le| 00001100 76 65 6c 25 29 20 2b 3d 20 c3 28 9e 29 20 2b 20 |vel%) += .(.) + | 00001110 22 29 20 69 6e 20 22 0d 05 14 41 20 20 20 20 20 |") in "...A | 00001120 20 20 20 20 20 4c 69 62 5f 45 72 72 6f 72 73 24 | Lib_Errors$| 00001130 28 4c 69 62 5f 45 72 72 6f 72 5f 4c 65 76 65 6c |(Lib_Error_Level| 00001140 25 29 20 2b 3d 20 22 60 22 2b 20 72 6f 75 74 69 |%) += "`"+ routi| 00001150 6e 65 24 2b 20 22 27 22 0d 05 1e 0d 20 20 20 20 |ne$+ "'".... | 00001160 20 20 20 20 cc 0d 05 28 40 20 20 20 20 20 20 20 | ...(@ | 00001170 20 20 20 4c 69 62 5f 45 72 72 6f 72 73 24 28 4c | Lib_Errors$(L| 00001180 69 62 5f 45 72 72 6f 72 5f 4c 65 76 65 6c 25 29 |ib_Error_Level%)| 00001190 20 3d 20 22 60 22 2b 20 72 6f 75 74 69 6e 65 24 | = "`"+ routine$| 000011a0 2b 20 22 27 22 0d 05 32 0d 20 20 20 20 20 20 20 |+ "'"..2. | 000011b0 20 cd 0d 05 3c 0b 20 20 20 20 20 20 cd 0d 05 46 | ...<. ...F| 000011c0 1f 20 20 20 20 20 20 4c 69 62 5f 45 72 72 6f 72 |. Lib_Error| 000011d0 5f 4c 65 76 65 6c 25 20 2b 3d 20 31 0d 05 50 11 |_Level% += 1..P.| 000011e0 20 20 20 20 20 20 85 20 9f 2c 20 22 22 0d 05 5a | . ., ""..Z| 000011f0 09 20 20 20 20 cd 0d 05 64 07 20 20 cd 0d 05 6e |. ...d. ...n| 00001200 05 e1 0d 05 78 05 3a 0d 05 82 1c dd 20 f2 5f 68 |....x.:..... ._h| 00001210 61 6e 64 6c 65 5f 6c 69 62 72 61 72 79 5f 65 72 |andle_library_er| 00001220 72 6f 72 0d 05 8c 10 ea 20 69 69 69 25 2c 20 65 |ror..... iii%, e| 00001230 65 65 24 0d 05 96 16 20 20 e7 20 57 69 6d 70 5f |ee$.... . Wimp_| 00001240 41 63 74 69 76 65 25 20 8c 0d 05 a0 17 20 20 20 |Active% ..... | 00001250 20 e7 20 44 65 62 75 67 5f 57 69 6d 70 25 20 8c | . Debug_Wimp% .| 00001260 0d 05 aa 2f 20 20 20 20 20 20 f2 5f 57 69 6d 70 |.../ ._Wimp| 00001270 5f 45 72 72 6f 72 28 9f 2c 20 f6 24 2b 20 22 20 |_Error(., .$+ " | 00001280 5b 22 2b 20 c3 28 9e 29 2b 20 22 5d 2e 22 29 0d |["+ .(.)+ "].").| 00001290 05 b4 1a 20 20 20 20 20 20 f2 5f 57 69 6d 70 5f |... ._Wimp_| 000012a0 43 6c 6f 73 65 44 6f 77 6e 0d 05 be 0b 20 20 20 |CloseDown.... | 000012b0 20 20 20 e0 0d 05 c8 09 20 20 20 20 cc 0d 05 d2 | ..... ....| 000012c0 1d 20 20 20 20 20 20 f2 5f 57 69 6d 70 5f 45 72 |. ._Wimp_Er| 000012d0 72 6f 72 28 9f 2c 20 f6 24 29 0d 05 dc 21 20 20 |ror(., .$)...! | 000012e0 20 20 20 20 e7 20 9f 3d 57 69 6d 70 5f 45 72 72 | . .=Wimp_Err| 000012f0 6f 72 5f 46 61 74 61 6c 25 20 8c 0d 05 e6 1c 20 |or_Fatal% ..... | 00001300 20 20 20 20 20 20 20 f2 5f 57 69 6d 70 5f 43 6c | ._Wimp_Cl| 00001310 6f 73 65 44 6f 77 6e 0d 05 f0 0d 20 20 20 20 20 |oseDown.... | 00001320 20 20 20 e0 0d 05 fa 0b 20 20 20 20 20 20 cd 0d | ..... ..| 00001330 06 04 09 20 20 20 20 cd 0d 06 0e 07 20 20 cc 0d |... ..... ..| 00001340 06 18 21 20 20 20 20 e7 20 4f 6e 5f 4c 69 62 5f |..! . On_Lib_| 00001350 45 72 72 6f 72 5f 4d 4f 44 45 25 3d 2d 32 20 8c |Error_MODE%=-2 .| 00001360 0d 06 22 20 20 20 20 20 20 20 e7 20 4c 69 62 5f |.." . Lib_| 00001370 45 72 72 6f 72 5f 4c 65 76 65 6c 25 3e 30 20 8c |Error_Level%>0 .| 00001380 0d 06 2c 21 20 20 20 20 20 20 20 20 85 20 a2 20 |..,! . . | 00001390 9f 2c 20 4c 69 62 5f 45 72 72 6f 72 73 24 28 30 |., Lib_Errors$(0| 000013a0 29 0d 06 36 0b 20 20 20 20 20 20 cc 0d 06 40 15 |)..6. ...@.| 000013b0 20 20 20 20 20 20 20 20 85 20 a2 20 9f 2c 20 f6 | . . ., .| 000013c0 24 0d 06 4a 0b 20 20 20 20 20 20 cd 0d 06 54 0b |$..J. ...T.| 000013d0 20 20 20 20 20 20 e0 0d 06 5e 09 20 20 20 20 cd | ...^. .| 000013e0 0d 06 68 21 20 20 20 20 e7 20 4f 6e 5f 4c 69 62 |..h! . On_Lib| 000013f0 5f 45 72 72 6f 72 5f 4d 4f 44 45 25 3e 3d 30 20 |_Error_MODE%>=0 | 00001400 8c 0d 06 72 33 20 20 20 20 20 20 eb 20 4f 6e 5f |...r3 . On_| 00001410 4c 69 62 5f 45 72 72 6f 72 5f 4d 4f 44 45 25 20 |Lib_Error_MODE% | 00001420 20 3a 20 20 f4 20 20 52 65 73 65 74 20 73 63 72 | : . Reset scr| 00001430 65 65 6e 2e 0d 06 7c 09 20 20 20 20 cd 0d 06 86 |een...|. ....| 00001440 23 20 20 20 20 f1 20 22 41 6e 20 65 72 72 6f 72 |# . "An error| 00001450 20 68 61 73 20 6f 63 63 75 72 65 64 2e 2e 2e 22 | has occured..."| 00001460 0d 06 90 09 20 20 20 20 f1 0d 06 9a 1c 20 20 20 |.... ..... | 00001470 20 e7 20 4c 69 62 5f 45 72 72 6f 72 5f 4c 65 76 | . Lib_Error_Lev| 00001480 65 6c 25 20 8c 0d 06 a4 28 20 20 20 20 20 20 e3 |el% ....( .| 00001490 20 69 69 69 25 3d 20 30 20 b8 20 4c 69 62 5f 45 | iii%= 0 . Lib_E| 000014a0 72 72 6f 72 5f 4c 65 76 65 6c 25 2d 31 0d 06 ae |rror_Level%-1...| 000014b0 29 20 20 20 20 20 20 20 20 fb 20 28 28 37 20 2d |) . ((7 -| 000014c0 20 28 69 69 69 25 20 3c 3c 20 31 29 29 20 80 20 | (iii% << 1)) . | 000014d0 36 29 20 2b 20 31 0d 06 b8 20 20 20 20 20 20 20 |6) + 1... | 000014e0 20 20 f1 20 4c 69 62 5f 45 72 72 6f 72 73 24 28 | . Lib_Errors$(| 000014f0 69 69 69 25 29 3b 0d 06 c2 29 20 20 20 20 20 20 |iii%);...) | 00001500 20 20 e7 20 69 69 69 25 3c 28 4c 69 62 5f 45 72 | . iii%<(Lib_Er| 00001510 72 6f 72 5f 4c 65 76 65 6c 25 2d 31 29 20 8c 0d |ror_Level%-1) ..| 00001520 06 cc 17 20 20 20 20 20 20 20 20 20 20 f1 20 22 |... . "| 00001530 20 69 6e 20 22 3b 0d 06 d6 0d 20 20 20 20 20 20 | in ";.... | 00001540 20 20 cd 0d 06 e0 10 20 20 20 20 20 20 ed 20 69 | ..... . i| 00001550 69 69 25 0d 06 ea 09 20 20 20 20 cc 0d 06 f4 24 |ii%.... ....$| 00001560 20 20 20 20 20 20 f1 20 f6 24 3b 20 22 20 28 6c | . .$; " (l| 00001570 69 6e 65 20 22 3b 20 c3 28 9e 29 3b 20 22 29 22 |ine "; .(.); ")"| 00001580 0d 06 fe 09 20 20 20 20 cd 0d 07 08 09 20 20 20 |.... ..... | 00001590 20 f1 0d 07 12 0b 20 20 20 20 fb 20 37 0d 07 1c | ..... . 7...| 000015a0 09 20 20 20 20 e0 0d 07 26 07 20 20 cd 0d 07 30 |. ...&. ...0| 000015b0 05 e1 0d ff |....| 000015b4