Home » CEEFAX disks » telesoftware15.adl » 21-02-89/Ask_Demo\B
21-02-89/Ask_Demo\B
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 » CEEFAX disks » telesoftware15.adl |
Filename: | 21-02-89/Ask_Demo\B |
Read OK: | ✔ |
File size: | 03D3 bytes |
Load address: | 0000 |
Exec address: | FFFFFFFF |
File contents
echo off cls echo ASK_KEY demo batch file echo echo Remember that "IF ERRORLEVEL n" becomes true echo when ERRORLEVEL is n or greater. So, ERRORLEVEL echo lists must work from the biggest value downwards echo or you'll get odd results echo echo You can abort this file with Control+C echo pause cls rem The blank lines are achieved with ECHO rem where signifies Ascii value 0 ( chr$(0) ) rem ________________________________________ :top echo echo Press one of P, C or A ask_key pca if ERRORLEVEL 3 goto 3 if ERRORLEVEL 2 goto 2 if ERRORLEVEL 1 goto 1 rem :1 not really necessary :1 echo This is option 1 echo ERRORLEVEL was 1 because you pressed P which is the first key in the list goto top :2 echo This is option 2 echo ERRORLEVEL was 2 because you pressed C which is the second key in the list goto top :3 echo This is option 3 echo ERRORLEVEL was 3 because you pressed A which is the third key in the list goto top
00000000 65 63 68 6f 20 6f 66 66 0d 0a 63 6c 73 0d 0a 65 |echo off..cls..e| 00000010 63 68 6f 20 41 53 4b 5f 4b 45 59 20 64 65 6d 6f |cho ASK_KEY demo| 00000020 20 62 61 74 63 68 20 66 69 6c 65 0d 0a 65 63 68 | batch file..ech| 00000030 6f 20 00 0d 0a 65 63 68 6f 20 52 65 6d 65 6d 62 |o ...echo Rememb| 00000040 65 72 20 74 68 61 74 20 22 49 46 20 45 52 52 4f |er that "IF ERRO| 00000050 52 4c 45 56 45 4c 20 6e 22 20 62 65 63 6f 6d 65 |RLEVEL n" become| 00000060 73 20 74 72 75 65 0d 0a 65 63 68 6f 20 77 68 65 |s true..echo whe| 00000070 6e 20 45 52 52 4f 52 4c 45 56 45 4c 20 69 73 20 |n ERRORLEVEL is | 00000080 6e 20 6f 72 20 67 72 65 61 74 65 72 2e 20 53 6f |n or greater. So| 00000090 2c 20 45 52 52 4f 52 4c 45 56 45 4c 0d 0a 65 63 |, ERRORLEVEL..ec| 000000a0 68 6f 20 6c 69 73 74 73 20 6d 75 73 74 20 77 6f |ho lists must wo| 000000b0 72 6b 20 66 72 6f 6d 20 74 68 65 20 62 69 67 67 |rk from the bigg| 000000c0 65 73 74 20 76 61 6c 75 65 20 64 6f 77 6e 77 61 |est value downwa| 000000d0 72 64 73 0d 0a 65 63 68 6f 20 6f 72 20 79 6f 75 |rds..echo or you| 000000e0 27 6c 6c 20 67 65 74 20 6f 64 64 20 72 65 73 75 |'ll get odd resu| 000000f0 6c 74 73 0d 0a 65 63 68 6f 20 00 0d 0a 65 63 68 |lts..echo ...ech| 00000100 6f 20 59 6f 75 20 63 61 6e 20 61 62 6f 72 74 20 |o You can abort | 00000110 74 68 69 73 20 66 69 6c 65 20 77 69 74 68 20 43 |this file with C| 00000120 6f 6e 74 72 6f 6c 2b 43 0d 0a 65 63 68 6f 20 00 |ontrol+C..echo .| 00000130 0d 0a 70 61 75 73 65 0d 0a 63 6c 73 0d 0a 72 65 |..pause..cls..re| 00000140 6d 20 54 68 65 20 62 6c 61 6e 6b 20 6c 69 6e 65 |m The blank line| 00000150 73 20 61 72 65 20 61 63 68 69 65 76 65 64 20 77 |s are achieved w| 00000160 69 74 68 20 45 43 48 4f 20 00 0d 0a 72 65 6d 20 |ith ECHO ...rem | 00000170 77 68 65 72 65 20 20 73 69 67 6e 69 66 69 65 73 |where signifies| 00000180 20 41 73 63 69 69 20 76 61 6c 75 65 20 30 20 28 | Ascii value 0 (| 00000190 20 63 68 72 24 28 30 29 20 29 0d 0a 72 65 6d 20 | chr$(0) )..rem | 000001a0 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f |________________| * 000001c0 5f 5f 5f 5f 5f 5f 5f 5f 0d 0a 0d 0a 3a 74 6f 70 |________....:top| 000001d0 0d 0a 65 63 68 6f 20 00 0d 0a 65 63 68 6f 20 50 |..echo ...echo P| 000001e0 72 65 73 73 20 6f 6e 65 20 6f 66 20 50 2c 20 43 |ress one of P, C| 000001f0 20 6f 72 20 41 0d 0a 61 73 6b 5f 6b 65 79 20 70 | or A..ask_key p| 00000200 63 61 0d 0a 0d 0a 69 66 20 45 52 52 4f 52 4c 45 |ca....if ERRORLE| 00000210 56 45 4c 20 33 20 67 6f 74 6f 20 33 0d 0a 69 66 |VEL 3 goto 3..if| 00000220 20 45 52 52 4f 52 4c 45 56 45 4c 20 32 20 67 6f | ERRORLEVEL 2 go| 00000230 74 6f 20 32 0d 0a 69 66 20 45 52 52 4f 52 4c 45 |to 2..if ERRORLE| 00000240 56 45 4c 20 31 20 67 6f 74 6f 20 31 0d 0a 0d 0a |VEL 1 goto 1....| 00000250 72 65 6d 20 3a 31 20 6e 6f 74 20 72 65 61 6c 6c |rem :1 not reall| 00000260 79 20 6e 65 63 65 73 73 61 72 79 0d 0a 0d 0a 3a |y necessary....:| 00000270 31 0d 0a 65 63 68 6f 20 54 68 69 73 20 69 73 20 |1..echo This is | 00000280 6f 70 74 69 6f 6e 20 31 0d 0a 65 63 68 6f 20 45 |option 1..echo E| 00000290 52 52 4f 52 4c 45 56 45 4c 20 77 61 73 20 31 20 |RRORLEVEL was 1 | 000002a0 62 65 63 61 75 73 65 20 79 6f 75 20 70 72 65 73 |because you pres| 000002b0 73 65 64 20 50 20 77 68 69 63 68 20 69 73 20 74 |sed P which is t| 000002c0 68 65 20 66 69 72 73 74 20 6b 65 79 20 69 6e 20 |he first key in | 000002d0 74 68 65 20 6c 69 73 74 0d 0a 67 6f 74 6f 20 74 |the list..goto t| 000002e0 6f 70 0d 0a 0d 0a 3a 32 0d 0a 65 63 68 6f 20 54 |op....:2..echo T| 000002f0 68 69 73 20 69 73 20 6f 70 74 69 6f 6e 20 32 0d |his is option 2.| 00000300 0a 65 63 68 6f 20 45 52 52 4f 52 4c 45 56 45 4c |.echo ERRORLEVEL| 00000310 20 77 61 73 20 32 20 62 65 63 61 75 73 65 20 79 | was 2 because y| 00000320 6f 75 20 70 72 65 73 73 65 64 20 43 20 77 68 69 |ou pressed C whi| 00000330 63 68 20 69 73 20 74 68 65 20 73 65 63 6f 6e 64 |ch is the second| 00000340 20 6b 65 79 20 69 6e 20 74 68 65 20 6c 69 73 74 | key in the list| 00000350 0d 0a 67 6f 74 6f 20 74 6f 70 0d 0a 0d 0a 3a 33 |..goto top....:3| 00000360 0d 0a 65 63 68 6f 20 54 68 69 73 20 69 73 20 6f |..echo This is o| 00000370 70 74 69 6f 6e 20 33 0d 0a 65 63 68 6f 20 45 52 |ption 3..echo ER| 00000380 52 4f 52 4c 45 56 45 4c 20 77 61 73 20 33 20 62 |RORLEVEL was 3 b| 00000390 65 63 61 75 73 65 20 79 6f 75 20 70 72 65 73 73 |ecause you press| 000003a0 65 64 20 41 20 77 68 69 63 68 20 69 73 20 74 68 |ed A which is th| 000003b0 65 20 74 68 69 72 64 20 6b 65 79 20 69 6e 20 74 |e third key in t| 000003c0 68 65 20 6c 69 73 74 0d 0a 67 6f 74 6f 20 74 6f |he list..goto to| 000003d0 70 0d 0a |p..| 000003d3