Home » Archimedes archive » Acorn User » AU 1997-Xmas B.adf » PD » NetPlex/!Netplex/!Help/HTML/cgi-bin/tasks
NetPlex/!Netplex/!Help/HTML/cgi-bin/tasks
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 » Acorn User » AU 1997-Xmas B.adf » PD |
Filename: | NetPlex/!Netplex/!Help/HTML/cgi-bin/tasks |
Read OK: | ✔ |
File size: | 04D1 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM >cgi-bin.tasks (Netplex Example) 20REM ========================================================================= 30REM Displays a list of all running tasks, and the current length of time the 31REM server has been 'up'. 40REM ========================================================================= 50 60LIBRARY "<Netplex$Dir>.CGILibrary" 70REM Set up error handler, redirection and library variables. 80PROCcgi_init 90 120PROCcgi_header("text/html",-1) 130 90SYS "Wimp_ReadSysInfo",0 TO active% 100 140PRINT "<HTML>"; 150PRINT "<HEAD>"; 151PRINT "<TITLE>Tasks</TITLE>"; 152PRINT "</HEAD>"; 153PRINT "<BODY>"; 160PRINT "<H1>"+STR$(active%)+" Tasks are currently active</H1>"; 170PRINT "<HR>"; 171PRINT "<PRE>"; 180 190DIM task% 15 200c%=0 210REPEAT 220 SYS "TaskManager_EnumerateTasks",c%,task%,16 TO c% 230 IF c%>=0 THEN 240 IF task%!12 AND 1 THEN a$="Module " ELSE a$="Application" 241 p%=task%!4 250 t$=FNstring_readtoctrl(p%) 260 PRINT "<B>"+a$+"</B> <I>"+t$+STRING$(20-LEN(t$)," ")+"</I> "+STR$(task%!8DIV1024)+"Kb<BR>"; 270 ENDIF 280UNTIL c%<0 290 291PRINT "</PRE>"; 300PRINT "<HR>"; 310PRINT "<H2>Total system uptime "+FNtime+"</H2>"; 330PRINT "</BODY>"; 331PRINT "</HTML>"; 340 350END 360 370DEF FNtime 381h%= TIME DIV 360000 382m%=(TIME MOD 360000) DIV 6000 383s%=(TIME MOD 6000) DIV 100 390=STR$(h%)+":"+RIGHT$("0"+STR$(m%),2)+":"+RIGHT$("0"+STR$(s%),2)
'� >cgi-bin.tasks (Netplex Example) O� ========================================================================= N� Displays a list of all running tasks, and the current length of time the � server has been 'up'. (O� ========================================================================= 2 <!ț "<Netplex$Dir>.CGILibrary" F>� Set up error handler, redirection and library variables. P �cgi_init Z x�cgi_header("text/html",-1) � Z%ș "Wimp_ReadSysInfo",0 � active% d �� "<HTML>"; �� "<HEAD>"; �� "<TITLE>Tasks</TITLE>"; �� "</HEAD>"; �� "<BODY>"; �;� "<H1>"+�(active%)+" Tasks are currently active</H1>"; � � "<HR>"; �� "<PRE>"; � �� task% 15 �c%=0 �� �6 ș "TaskManager_EnumerateTasks",c%,task%,16 � c% � � c%>=0 � �< � task%!12 � 1 � a$="Module " � a$="Application" � p%=task%!4 �! t$=�string_readtoctrl(p%) S � "<B>"+a$+"</B> <I>"+t$+�20-�(t$)," ")+"</I> "+�(task%!8�1024)+"Kb<BR>"; � � c%<0 " #� "</PRE>"; , � "<HR>"; 6/� "<H2>Total system uptime "+�time+"</H2>"; J� "</BODY>"; K� "</HTML>"; T ^� h r� �time }h%= � � 360000 ~m%=(� � 360000) � 6000 s%=(� � 6000) � 100 �.=�(h%)+":"+�"0"+�(m%),2)+":"+�"0"+�(s%),2) �
00000000 0d 00 0a 27 f4 20 3e 63 67 69 2d 62 69 6e 2e 74 |...'. >cgi-bin.t| 00000010 61 73 6b 73 20 20 28 4e 65 74 70 6c 65 78 20 45 |asks (Netplex E| 00000020 78 61 6d 70 6c 65 29 0d 00 14 4f f4 20 3d 3d 3d |xample)...O. ===| 00000030 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| * 00000070 3d 3d 3d 3d 3d 3d 0d 00 1e 4e f4 20 44 69 73 70 |======...N. Disp| 00000080 6c 61 79 73 20 61 20 6c 69 73 74 20 6f 66 20 61 |lays a list of a| 00000090 6c 6c 20 72 75 6e 6e 69 6e 67 20 74 61 73 6b 73 |ll running tasks| 000000a0 2c 20 61 6e 64 20 74 68 65 20 63 75 72 72 65 6e |, and the curren| 000000b0 74 20 6c 65 6e 67 74 68 20 6f 66 20 74 69 6d 65 |t length of time| 000000c0 20 74 68 65 0d 00 1f 1b f4 20 73 65 72 76 65 72 | the..... server| 000000d0 20 68 61 73 20 62 65 65 6e 20 27 75 70 27 2e 0d | has been 'up'..| 000000e0 00 28 4f f4 20 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |.(O. ===========| 000000f0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| * 00000120 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0d 00 |==============..| 00000130 32 04 0d 00 3c 21 c8 9b 20 22 3c 4e 65 74 70 6c |2...<!.. "<Netpl| 00000140 65 78 24 44 69 72 3e 2e 43 47 49 4c 69 62 72 61 |ex$Dir>.CGILibra| 00000150 72 79 22 0d 00 46 3e f4 20 53 65 74 20 75 70 20 |ry"..F>. Set up | 00000160 65 72 72 6f 72 20 68 61 6e 64 6c 65 72 2c 20 72 |error handler, r| 00000170 65 64 69 72 65 63 74 69 6f 6e 20 61 6e 64 20 6c |edirection and l| 00000180 69 62 72 61 72 79 20 76 61 72 69 61 62 6c 65 73 |ibrary variables| 00000190 2e 0d 00 50 0d f2 63 67 69 5f 69 6e 69 74 0d 00 |...P..cgi_init..| 000001a0 5a 04 0d 00 78 1f f2 63 67 69 5f 68 65 61 64 65 |Z...x..cgi_heade| 000001b0 72 28 22 74 65 78 74 2f 68 74 6d 6c 22 2c 2d 31 |r("text/html",-1| 000001c0 29 0d 00 82 04 0d 00 5a 25 c8 99 20 22 57 69 6d |)......Z%.. "Wim| 000001d0 70 5f 52 65 61 64 53 79 73 49 6e 66 6f 22 2c 30 |p_ReadSysInfo",0| 000001e0 20 b8 20 61 63 74 69 76 65 25 0d 00 64 04 0d 00 | . active%..d...| 000001f0 8c 0f f1 20 22 3c 48 54 4d 4c 3e 22 3b 0d 00 96 |... "<HTML>";...| 00000200 0f f1 20 22 3c 48 45 41 44 3e 22 3b 0d 00 97 1d |.. "<HEAD>";....| 00000210 f1 20 22 3c 54 49 54 4c 45 3e 54 61 73 6b 73 3c |. "<TITLE>Tasks<| 00000220 2f 54 49 54 4c 45 3e 22 3b 0d 00 98 10 f1 20 22 |/TITLE>";..... "| 00000230 3c 2f 48 45 41 44 3e 22 3b 0d 00 99 0f f1 20 22 |</HEAD>";..... "| 00000240 3c 42 4f 44 59 3e 22 3b 0d 00 a0 3b f1 20 22 3c |<BODY>";...;. "<| 00000250 48 31 3e 22 2b c3 28 61 63 74 69 76 65 25 29 2b |H1>"+.(active%)+| 00000260 22 20 54 61 73 6b 73 20 61 72 65 20 63 75 72 72 |" Tasks are curr| 00000270 65 6e 74 6c 79 20 61 63 74 69 76 65 3c 2f 48 31 |ently active</H1| 00000280 3e 22 3b 0d 00 aa 0d f1 20 22 3c 48 52 3e 22 3b |>";..... "<HR>";| 00000290 0d 00 ab 0e f1 20 22 3c 50 52 45 3e 22 3b 0d 00 |..... "<PRE>";..| 000002a0 b4 04 0d 00 be 0e de 20 74 61 73 6b 25 20 31 35 |....... task% 15| 000002b0 0d 00 c8 08 63 25 3d 30 0d 00 d2 05 f5 0d 00 dc |....c%=0........| 000002c0 36 20 20 c8 99 20 22 54 61 73 6b 4d 61 6e 61 67 |6 .. "TaskManag| 000002d0 65 72 5f 45 6e 75 6d 65 72 61 74 65 54 61 73 6b |er_EnumerateTask| 000002e0 73 22 2c 63 25 2c 74 61 73 6b 25 2c 31 36 20 b8 |s",c%,task%,16 .| 000002f0 20 63 25 0d 00 e6 0f 20 20 e7 20 63 25 3e 3d 30 | c%.... . c%>=0| 00000300 20 8c 0d 00 f0 3c 20 20 20 20 e7 20 74 61 73 6b | ....< . task| 00000310 25 21 31 32 20 80 20 31 20 8c 20 61 24 3d 22 4d |%!12 . 1 . a$="M| 00000320 6f 64 75 6c 65 20 20 20 20 20 22 20 8b 20 61 24 |odule " . a$| 00000330 3d 22 41 70 70 6c 69 63 61 74 69 6f 6e 22 0d 00 |="Application"..| 00000340 f1 12 20 20 20 20 70 25 3d 74 61 73 6b 25 21 34 |.. p%=task%!4| 00000350 0d 00 fa 21 20 20 20 20 74 24 3d a4 73 74 72 69 |...! t$=.stri| 00000360 6e 67 5f 72 65 61 64 74 6f 63 74 72 6c 28 70 25 |ng_readtoctrl(p%| 00000370 29 0d 01 04 53 20 20 20 20 f1 20 22 3c 42 3e 22 |)...S . "<B>"| 00000380 2b 61 24 2b 22 3c 2f 42 3e 20 20 3c 49 3e 22 2b |+a$+"</B> <I>"+| 00000390 74 24 2b c4 32 30 2d a9 28 74 24 29 2c 22 20 22 |t$+.20-.(t$)," "| 000003a0 29 2b 22 3c 2f 49 3e 20 20 22 2b c3 28 74 61 73 |)+"</I> "+.(tas| 000003b0 6b 25 21 38 81 31 30 32 34 29 2b 22 4b 62 3c 42 |k%!8.1024)+"Kb<B| 000003c0 52 3e 22 3b 0d 01 0e 07 20 20 cd 0d 01 18 0a fd |R>";.... ......| 000003d0 20 63 25 3c 30 0d 01 22 04 0d 01 23 0f f1 20 22 | c%<0.."...#.. "| 000003e0 3c 2f 50 52 45 3e 22 3b 0d 01 2c 0d f1 20 22 3c |</PRE>";..,.. "<| 000003f0 48 52 3e 22 3b 0d 01 36 2f f1 20 22 3c 48 32 3e |HR>";..6/. "<H2>| 00000400 54 6f 74 61 6c 20 73 79 73 74 65 6d 20 75 70 74 |Total system upt| 00000410 69 6d 65 20 22 2b a4 74 69 6d 65 2b 22 3c 2f 48 |ime "+.time+"</H| 00000420 32 3e 22 3b 0d 01 4a 10 f1 20 22 3c 2f 42 4f 44 |2>";..J.. "</BOD| 00000430 59 3e 22 3b 0d 01 4b 10 f1 20 22 3c 2f 48 54 4d |Y>";..K.. "</HTM| 00000440 4c 3e 22 3b 0d 01 54 04 0d 01 5e 05 e0 0d 01 68 |L>";..T...^....h| 00000450 04 0d 01 72 0b dd 20 a4 74 69 6d 65 0d 01 7d 12 |...r.. .time..}.| 00000460 68 25 3d 20 91 20 81 20 33 36 30 30 30 30 0d 01 |h%= . . 360000..| 00000470 7e 1a 6d 25 3d 28 91 20 83 20 33 36 30 30 30 30 |~.m%=(. . 360000| 00000480 29 20 81 20 36 30 30 30 0d 01 7f 19 73 25 3d 28 |) . 6000....s%=(| 00000490 91 20 83 20 20 20 36 30 30 30 29 20 81 20 31 30 |. . 6000) . 10| 000004a0 30 0d 01 86 2e 3d c3 28 68 25 29 2b 22 3a 22 2b |0....=.(h%)+":"+| 000004b0 c2 22 30 22 2b c3 28 6d 25 29 2c 32 29 2b 22 3a |."0"+.(m%),2)+":| 000004c0 22 2b c2 22 30 22 2b c3 28 73 25 29 2c 32 29 0d |"+."0"+.(s%),2).| 000004d0 ff |.| 000004d1