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

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

Listing1 demonstrates passing of arrays to procedures and functions. Run the program, and enter a number between 1 and 5. This will print out a full name consisting of a first name and a surname, corresponding to the names set up in the two arrays firstname$ and surname$. Press Esc to return to the desktop.

Listing2 shows how recursion works. Run the program and enter any word at the prompt. All the possible anagrams of that word will be shown (including anagrams which aren't real words) followed by the total number of anagrams.

For more information, see the article on page 95 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 73 20 66 72  6f 6d 20 74 68 65 20 6e  |grams from the n|
00000090  69 6e 74 68 20 70 61 72  74 20 6f 66 20 74 68 65  |inth 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  70 61 73 73 69 6e 67 20  6f 66 20 61 72 72 61 79  |passing of array|
000000f0  73 20 74 6f 20 70 72 6f  63 65 64 75 72 65 73 20  |s to procedures |
00000100  61 6e 64 20 66 75 6e 63  74 69 6f 6e 73 2e 20 52  |and functions. R|
00000110  75 6e 20 74 68 65 20 70  72 6f 67 72 61 6d 2c 20  |un the program, |
00000120  61 6e 64 20 65 6e 74 65  72 20 61 20 6e 75 6d 62  |and enter a numb|
00000130  65 72 20 62 65 74 77 65  65 6e 20 31 20 61 6e 64  |er between 1 and|
00000140  20 35 2e 20 54 68 69 73  20 77 69 6c 6c 20 70 72  | 5. This will pr|
00000150  69 6e 74 20 6f 75 74 20  61 20 66 75 6c 6c 20 6e  |int out a full n|
00000160  61 6d 65 20 63 6f 6e 73  69 73 74 69 6e 67 20 6f  |ame consisting o|
00000170  66 20 61 20 66 69 72 73  74 20 6e 61 6d 65 20 61  |f a first name a|
00000180  6e 64 20 61 20 73 75 72  6e 61 6d 65 2c 20 63 6f  |nd a surname, co|
00000190  72 72 65 73 70 6f 6e 64  69 6e 67 20 74 6f 20 74  |rresponding to t|
000001a0  68 65 20 6e 61 6d 65 73  20 73 65 74 20 75 70 20  |he names set up |
000001b0  69 6e 20 74 68 65 20 74  77 6f 20 61 72 72 61 79  |in the two array|
000001c0  73 20 66 69 72 73 74 6e  61 6d 65 24 20 61 6e 64  |s firstname$ and|
000001d0  20 73 75 72 6e 61 6d 65  24 2e 20 50 72 65 73 73  | surname$. Press|
000001e0  20 45 73 63 20 74 6f 20  72 65 74 75 72 6e 20 74  | Esc to return t|
000001f0  6f 20 74 68 65 20 64 65  73 6b 74 6f 70 2e 0a 0a  |o the desktop...|
00000200  4c 69 73 74 69 6e 67 32  20 73 68 6f 77 73 20 68  |Listing2 shows h|
00000210  6f 77 20 72 65 63 75 72  73 69 6f 6e 20 77 6f 72  |ow recursion wor|
00000220  6b 73 2e 20 52 75 6e 20  74 68 65 20 70 72 6f 67  |ks. Run the prog|
00000230  72 61 6d 20 61 6e 64 20  65 6e 74 65 72 20 61 6e  |ram and enter an|
00000240  79 20 77 6f 72 64 20 61  74 20 74 68 65 20 70 72  |y word at the pr|
00000250  6f 6d 70 74 2e 20 41 6c  6c 20 74 68 65 20 70 6f  |ompt. All the po|
00000260  73 73 69 62 6c 65 20 61  6e 61 67 72 61 6d 73 20  |ssible anagrams |
00000270  6f 66 20 74 68 61 74 20  77 6f 72 64 20 77 69 6c  |of that word wil|
00000280  6c 20 62 65 20 73 68 6f  77 6e 20 28 69 6e 63 6c  |l be shown (incl|
00000290  75 64 69 6e 67 20 61 6e  61 67 72 61 6d 73 20 77  |uding anagrams w|
000002a0  68 69 63 68 20 61 72 65  6e 27 74 20 72 65 61 6c  |hich aren't real|
000002b0  20 77 6f 72 64 73 29 20  66 6f 6c 6c 6f 77 65 64  | words) followed|
000002c0  20 62 79 20 74 68 65 20  74 6f 74 61 6c 20 6e 75  | by the total nu|
000002d0  6d 62 65 72 20 6f 66 20  61 6e 61 67 72 61 6d 73  |mber of anagrams|
000002e0  2e 0a 0a 46 6f 72 20 6d  6f 72 65 20 69 6e 66 6f  |...For more info|
000002f0  72 6d 61 74 69 6f 6e 2c  20 73 65 65 20 74 68 65  |rmation, see the|
00000300  20 61 72 74 69 63 6c 65  20 6f 6e 20 70 61 67 65  | article on page|
00000310  20 39 35 20 69 6e 20 74  68 65 20 6d 61 67 61 7a  | 95 in the magaz|
00000320  69 6e 65 2e 0a 0a a9 20  43 6f 70 79 72 69 67 68  |ine.... Copyrigh|
00000330  74 20 41 63 6f 72 6e 20  55 73 65 72 20 31 39 39  |t Acorn User 199|
00000340  34 0a                                             |4.|
00000342