Home » Archimedes archive » Acorn User » AU 1994-01.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-01.adf
Filename: !BasicProg/!Help
Read OK:
File size: 0452 bytes
Load address: FFFFFF44
Exec address: FB25BC1E
File contents
Back to Basics: Learning to Program in Basic
By Mark Moxon

Run this option to open a directory containing three example Basic programs from the sixth part of the series on learning to program in Basic.

Listing1 shows how to implement a very simple array. Enter a number between 0 and 3 to display the English equivalent of that number. To exit the program, press ESCAPE or enter a number outside the range 0-3.
              
Listing2 shows a FOR-NEXT loop in operation. When you run the program, enter a number larger than zero, and the loop will repeat that many times.

Listing3 implements a very simple address database. To use the program, enter A or S (note: capitals) to enter a new address, or search for a name respectively. To enter an address, simply enter the name, followed by RETURN, followed by three address lines (each ended by RETURN). To search for entries containing a certain string in the name field, choose the S option. Now type in your search string, and any matches will be shown.

For more information, see the article on page 103 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 72 65 65  |containing three|
00000070  20 65 78 61 6d 70 6c 65  20 42 61 73 69 63 20 70  | example Basic p|
00000080  72 6f 67 72 61 6d 73 20  66 72 6f 6d 20 74 68 65  |rograms from the|
00000090  20 73 69 78 74 68 20 70  61 72 74 20 6f 66 20 74  | sixth part of t|
000000a0  68 65 20 73 65 72 69 65  73 20 6f 6e 20 6c 65 61  |he series on lea|
000000b0  72 6e 69 6e 67 20 74 6f  20 70 72 6f 67 72 61 6d  |rning to program|
000000c0  20 69 6e 20 42 61 73 69  63 2e 0a 0a 4c 69 73 74  | in Basic...List|
000000d0  69 6e 67 31 20 73 68 6f  77 73 20 68 6f 77 20 74  |ing1 shows how t|
000000e0  6f 20 69 6d 70 6c 65 6d  65 6e 74 20 61 20 76 65  |o implement a ve|
000000f0  72 79 20 73 69 6d 70 6c  65 20 61 72 72 61 79 2e  |ry simple array.|
00000100  20 45 6e 74 65 72 20 61  20 6e 75 6d 62 65 72 20  | Enter a number |
00000110  62 65 74 77 65 65 6e 20  30 20 61 6e 64 20 33 20  |between 0 and 3 |
00000120  74 6f 20 64 69 73 70 6c  61 79 20 74 68 65 20 45  |to display the E|
00000130  6e 67 6c 69 73 68 20 65  71 75 69 76 61 6c 65 6e  |nglish equivalen|
00000140  74 20 6f 66 20 74 68 61  74 20 6e 75 6d 62 65 72  |t of that number|
00000150  2e 20 54 6f 20 65 78 69  74 20 74 68 65 20 70 72  |. To exit the pr|
00000160  6f 67 72 61 6d 2c 20 70  72 65 73 73 20 45 53 43  |ogram, press ESC|
00000170  41 50 45 20 6f 72 20 65  6e 74 65 72 20 61 20 6e  |APE or enter a n|
00000180  75 6d 62 65 72 20 6f 75  74 73 69 64 65 20 74 68  |umber outside th|
00000190  65 20 72 61 6e 67 65 20  30 2d 33 2e 0a 20 20 20  |e range 0-3..   |
000001a0  20 20 20 20 20 20 20 20  20 20 20 0a 4c 69 73 74  |           .List|
000001b0  69 6e 67 32 20 73 68 6f  77 73 20 61 20 46 4f 52  |ing2 shows a FOR|
000001c0  2d 4e 45 58 54 20 6c 6f  6f 70 20 69 6e 20 6f 70  |-NEXT loop in op|
000001d0  65 72 61 74 69 6f 6e 2e  20 57 68 65 6e 20 79 6f  |eration. When yo|
000001e0  75 20 72 75 6e 20 74 68  65 20 70 72 6f 67 72 61  |u run the progra|
000001f0  6d 2c 20 65 6e 74 65 72  20 61 20 6e 75 6d 62 65  |m, enter a numbe|
00000200  72 20 6c 61 72 67 65 72  20 74 68 61 6e 20 7a 65  |r larger than ze|
00000210  72 6f 2c 20 61 6e 64 20  74 68 65 20 6c 6f 6f 70  |ro, and the loop|
00000220  20 77 69 6c 6c 20 72 65  70 65 61 74 20 74 68 61  | will repeat tha|
00000230  74 20 6d 61 6e 79 20 74  69 6d 65 73 2e 0a 0a 4c  |t many times...L|
00000240  69 73 74 69 6e 67 33 20  69 6d 70 6c 65 6d 65 6e  |isting3 implemen|
00000250  74 73 20 61 20 76 65 72  79 20 73 69 6d 70 6c 65  |ts a very simple|
00000260  20 61 64 64 72 65 73 73  20 64 61 74 61 62 61 73  | address databas|
00000270  65 2e 20 54 6f 20 75 73  65 20 74 68 65 20 70 72  |e. To use the pr|
00000280  6f 67 72 61 6d 2c 20 65  6e 74 65 72 20 41 20 6f  |ogram, enter A o|
00000290  72 20 53 20 28 6e 6f 74  65 3a 20 63 61 70 69 74  |r S (note: capit|
000002a0  61 6c 73 29 20 74 6f 20  65 6e 74 65 72 20 61 20  |als) to enter a |
000002b0  6e 65 77 20 61 64 64 72  65 73 73 2c 20 6f 72 20  |new address, or |
000002c0  73 65 61 72 63 68 20 66  6f 72 20 61 20 6e 61 6d  |search for a nam|
000002d0  65 20 72 65 73 70 65 63  74 69 76 65 6c 79 2e 20  |e respectively. |
000002e0  54 6f 20 65 6e 74 65 72  20 61 6e 20 61 64 64 72  |To enter an addr|
000002f0  65 73 73 2c 20 73 69 6d  70 6c 79 20 65 6e 74 65  |ess, simply ente|
00000300  72 20 74 68 65 20 6e 61  6d 65 2c 20 66 6f 6c 6c  |r the name, foll|
00000310  6f 77 65 64 20 62 79 20  52 45 54 55 52 4e 2c 20  |owed by RETURN, |
00000320  66 6f 6c 6c 6f 77 65 64  20 62 79 20 74 68 72 65  |followed by thre|
00000330  65 20 61 64 64 72 65 73  73 20 6c 69 6e 65 73 20  |e address lines |
00000340  28 65 61 63 68 20 65 6e  64 65 64 20 62 79 20 52  |(each ended by R|
00000350  45 54 55 52 4e 29 2e 20  54 6f 20 73 65 61 72 63  |ETURN). To searc|
00000360  68 20 66 6f 72 20 65 6e  74 72 69 65 73 20 63 6f  |h for entries co|
00000370  6e 74 61 69 6e 69 6e 67  20 61 20 63 65 72 74 61  |ntaining a certa|
00000380  69 6e 20 73 74 72 69 6e  67 20 69 6e 20 74 68 65  |in string in the|
00000390  20 6e 61 6d 65 20 66 69  65 6c 64 2c 20 63 68 6f  | name field, cho|
000003a0  6f 73 65 20 74 68 65 20  53 20 6f 70 74 69 6f 6e  |ose the S option|
000003b0  2e 20 4e 6f 77 20 74 79  70 65 20 69 6e 20 79 6f  |. Now type in yo|
000003c0  75 72 20 73 65 61 72 63  68 20 73 74 72 69 6e 67  |ur search string|
000003d0  2c 20 61 6e 64 20 61 6e  79 20 6d 61 74 63 68 65  |, and any matche|
000003e0  73 20 77 69 6c 6c 20 62  65 20 73 68 6f 77 6e 2e  |s will be shown.|
000003f0  0a 0a 46 6f 72 20 6d 6f  72 65 20 69 6e 66 6f 72  |..For more infor|
00000400  6d 61 74 69 6f 6e 2c 20  73 65 65 20 74 68 65 20  |mation, see the |
00000410  61 72 74 69 63 6c 65 20  6f 6e 20 70 61 67 65 20  |article on page |
00000420  31 30 33 20 69 6e 20 74  68 65 20 6d 61 67 61 7a  |103 in the magaz|
00000430  69 6e 65 2e 0a 0a a9 20  43 6f 70 79 72 69 67 68  |ine.... Copyrigh|
00000440  74 20 41 63 6f 72 6e 20  55 73 65 72 20 31 39 39  |t Acorn User 199|
00000450  34 0a                                             |4.|
00000452