Home » Archimedes archive » Acorn User » AU 1994-03.adf » !BasicProg/!Help
!BasicProg/!Help
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 1994-03.adf |
Filename: | !BasicProg/!Help |
Read OK: | ✔ |
File size: | 0290 bytes |
Load address: | FFFFFF45 |
Exec address: | 24657C0D |
File contents
Back to Basics: Learning to Program in Basic By Mark Moxon Run this option to open a directory containing the example Basic program from the eighth part of the series on learning to program in Basic. Listing1 demonstrates how to extract the filename and pathname from a full filename using functions. When you run the program, enter a full filename, such as ADFS::Mark.$.tmp.TextFile and the program will display the pathname and the filename. Listing2 shows how using the LOCAL statement can protect variable values over calls to procedures and functions. For more information, see the article on page 93 in the magazine. � Copyright Acorn User 1994
00000000 42 61 63 6b 20 74 6f 20 42 61 73 69 63 73 3a 20 |Back to Basics: | 00000010 4c 65 61 72 6e 69 6e 67 20 74 6f 20 50 72 6f 67 |Learning to Prog| 00000020 72 61 6d 20 69 6e 20 42 61 73 69 63 0a 42 79 20 |ram in Basic.By | 00000030 4d 61 72 6b 20 4d 6f 78 6f 6e 0a 0a 52 75 6e 20 |Mark Moxon..Run | 00000040 74 68 69 73 20 6f 70 74 69 6f 6e 20 74 6f 20 6f |this option to o| 00000050 70 65 6e 20 61 20 64 69 72 65 63 74 6f 72 79 20 |pen a directory | 00000060 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 65 |containing the e| 00000070 78 61 6d 70 6c 65 20 42 61 73 69 63 20 70 72 6f |xample Basic pro| 00000080 67 72 61 6d 20 66 72 6f 6d 20 74 68 65 20 65 69 |gram from the ei| 00000090 67 68 74 68 20 70 61 72 74 20 6f 66 20 74 68 65 |ghth part of the| 000000a0 20 73 65 72 69 65 73 20 6f 6e 20 6c 65 61 72 6e | series on learn| 000000b0 69 6e 67 20 74 6f 20 70 72 6f 67 72 61 6d 20 69 |ing to program i| 000000c0 6e 20 42 61 73 69 63 2e 0a 0a 4c 69 73 74 69 6e |n Basic...Listin| 000000d0 67 31 20 64 65 6d 6f 6e 73 74 72 61 74 65 73 20 |g1 demonstrates | 000000e0 68 6f 77 20 74 6f 20 65 78 74 72 61 63 74 20 74 |how to extract t| 000000f0 68 65 20 66 69 6c 65 6e 61 6d 65 20 61 6e 64 20 |he filename and | 00000100 70 61 74 68 6e 61 6d 65 20 66 72 6f 6d 20 61 20 |pathname from a | 00000110 66 75 6c 6c 20 66 69 6c 65 6e 61 6d 65 20 75 73 |full filename us| 00000120 69 6e 67 20 66 75 6e 63 74 69 6f 6e 73 2e 20 57 |ing functions. W| 00000130 68 65 6e 20 79 6f 75 20 72 75 6e 20 74 68 65 20 |hen you run the | 00000140 70 72 6f 67 72 61 6d 2c 20 65 6e 74 65 72 20 61 |program, enter a| 00000150 20 66 75 6c 6c 20 66 69 6c 65 6e 61 6d 65 2c 20 | full filename, | 00000160 73 75 63 68 20 61 73 20 41 44 46 53 3a 3a 4d 61 |such as ADFS::Ma| 00000170 72 6b 2e 24 2e 74 6d 70 2e 54 65 78 74 46 69 6c |rk.$.tmp.TextFil| 00000180 65 20 61 6e 64 20 74 68 65 20 70 72 6f 67 72 61 |e and the progra| 00000190 6d 20 77 69 6c 6c 20 64 69 73 70 6c 61 79 20 74 |m will display t| 000001a0 68 65 20 70 61 74 68 6e 61 6d 65 20 61 6e 64 20 |he pathname and | 000001b0 74 68 65 20 66 69 6c 65 6e 61 6d 65 2e 0a 0a 4c |the filename...L| 000001c0 69 73 74 69 6e 67 32 20 73 68 6f 77 73 20 68 6f |isting2 shows ho| 000001d0 77 20 75 73 69 6e 67 20 74 68 65 20 4c 4f 43 41 |w using the LOCA| 000001e0 4c 20 73 74 61 74 65 6d 65 6e 74 20 63 61 6e 20 |L statement can | 000001f0 70 72 6f 74 65 63 74 20 76 61 72 69 61 62 6c 65 |protect variable| 00000200 20 76 61 6c 75 65 73 20 6f 76 65 72 20 63 61 6c | values over cal| 00000210 6c 73 20 74 6f 20 70 72 6f 63 65 64 75 72 65 73 |ls to procedures| 00000220 20 61 6e 64 20 66 75 6e 63 74 69 6f 6e 73 2e 0a | and functions..| 00000230 0a 46 6f 72 20 6d 6f 72 65 20 69 6e 66 6f 72 6d |.For more inform| 00000240 61 74 69 6f 6e 2c 20 73 65 65 20 74 68 65 20 61 |ation, see the a| 00000250 72 74 69 63 6c 65 20 6f 6e 20 70 61 67 65 20 39 |rticle on page 9| 00000260 33 20 69 6e 20 74 68 65 20 6d 61 67 61 7a 69 6e |3 in the magazin| 00000270 65 2e 0a 0a a9 20 43 6f 70 79 72 69 67 68 74 20 |e.... Copyright | 00000280 41 63 6f 72 6e 20 55 73 65 72 20 31 39 39 34 0a |Acorn User 1994.| 00000290