Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_19.ADF » F/Scren1

F/Scren1

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 » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_19.ADF
Filename: F/Scren1
Read OK:
File size: 1416 bytes
Load address: 53204556
Exec address: 6E657263
File contents
Programming the opening screen.

I needed an opening screen this time because no-one has sent 
anything.

This is how I did it.

10MODE6 Fairly obvious but necessary because some of the 
positioning statements later wouldn't work as expected in 
another mode. Try changing the MODE to say MODE2 to see what 
I mean.

20CLS This makes sure that the screen is clear before 
starting. Again remove this line to see the effect.

30VDU23,1,0;0;0;0; This turns off the flashing cursor.

40PRINTTAB(11,4)"NEWS,   OPINIONS," 
50PRINTTAB(13,6)"PROGRAMMING" 
60PRINTTAB(12,8)"IT'S YOUR EUG"  
These lines print the heading statement. The TAB(ii,dd) 
after PRINT makes sure that the words are printed in 
particular positions. ii is the position in from the left 
hand side while the dd is the position down from the top of 
the screen.

70B%=10000 This is a variable, an integer  variable infact.
An integer variable can hold any whole number. I used this 
because I needed a number  later on for the computer to 
count up to before it did something, rather like counting 
up to 100 when you play hide and seek, you do play don't 
you?

80FOR A= 1TO 8 This line starts what is known as a FOR NEXT 
loop. Now it says 'there is a variable called A. This 
variable is initially equal to 1. The following lines should 
be executed by the computer in the normal way until the 
computer finds an instruction NEXT A. At this point A will 
equal 2 and the computer should return to the line defining 
the start of the FOR NEXT loop, in this case line 80 and 
then execute all the instructions again.' It will continue to 
do this adding 1 to A each time untill A = 8 when it will 
leave the loop and start executing any instructions after 
the NEXT A command.

If you type in 10FOR A= 1 TO 10
               20PRINT"EUG"A
               30NEXT A
               40PRINT"Done"

then RUN this you will see EUG printed on the screen 10 
times. After EUG will be written a number equal to A so that 
you will have a sequence of EUG's. Line 40 will not be 
executed untill the FOR NEXT loop has finished so it will
only be printed once at the end of the program.

The FOR NEXT loop is one of the most fundamental commands in 
BASIC. Indeed loops similar to this are the most fundemental 
commands on any computer including multi-million pound 
machines.

90READ A$ The READ command tells the computer to look into 
DATA statements, and what ever is in there to put this into 
the variable following the READ command. In this case the 
DATA statements have text in them so the variable is A$ the 
$ is pronounced dollar. A $ variable is used for text and is 
more properly called a string variable since a sequence of
text is known as a string    
%, pronounced percent, variable is used for whole numbers.  
% variable is properly called an interger variable. 
A variable without a sign is called a real variable and 
can be used for whole numbers and fractions. 
I used real variables simply to save some time typing but 
sometimes it is necessary to use an integer variable for 
example when the counting in the FOR NEXT loop might 
produce a fraction which you want the computer to ignore. 
The first DATA statement is read on the first pass of the 
loop, on the second pass the second DATA statement is read 
an so on.

100PRINTTAB(1,12)A$ This simply tells the computer to print 
A$ whatever it happens to be at that time in a particular 
position.

110PRINTTAB(1,19)" This line would offend most BASIC 
programmers. It prints a blank line in a particular position 
which is used further down the program. So when this 
position has something written onto it later on in the 
program, the loop cycles around and executes this line again
and this line effectivly erases this position.
There are more elegant ways of doing this but this works 
quite well and.....

120FORT%=1 TO B% This is another FOR NEXT loop. This time 
its purpose is simply to make the computer wait for a while 
before executing the next instruction because it has to 
count up to 10000 which is what B% is equal to. In this 
case its purpose is to make some time to read A$ from line 
100. Again there are more elegant ways to do this but....

The variable B% is used because when I was developing the 
program I wanted to make it run quite fast. I didn't need to 
read A$ since I had written A$. During development I was 
setting B% to 100.This trick is used again later on so 
that delays are all of the same length.

130NEXTT% See above.

140READ B$ This is exactly the same as the READ A$. But in 
this case it will be the next DATA statement down.

150PRINTTAB(1,19)B$ Again the same as line 100 but notice 
that the position for printing is different.

160PRINTTAB(1,12)" This puts a blank line in the position 
where A$ was printed. A$ is erased and so B$ looks like a 
reply to A$.

170FORT%=1 TO B%
180NEXTT%        This is an identical delay to lines 120 
and 130

190NEXT A This is the end of the original FOR NEXT loop. the 
computer will add one to A and then go back to line 80 to 
loop through the instructions again until of course A = 8
00000000  50 72 6f 67 72 61 6d 6d  69 6e 67 20 74 68 65 20  |Programming the |
00000010  6f 70 65 6e 69 6e 67 20  73 63 72 65 65 6e 2e 0d  |opening screen..|
00000020  0d 49 20 6e 65 65 64 65  64 20 61 6e 20 6f 70 65  |.I needed an ope|
00000030  6e 69 6e 67 20 73 63 72  65 65 6e 20 74 68 69 73  |ning screen this|
00000040  20 74 69 6d 65 20 62 65  63 61 75 73 65 20 6e 6f  | time because no|
00000050  2d 6f 6e 65 20 68 61 73  20 73 65 6e 74 20 0d 61  |-one has sent .a|
00000060  6e 79 74 68 69 6e 67 2e  0d 0d 54 68 69 73 20 69  |nything...This i|
00000070  73 20 68 6f 77 20 49 20  64 69 64 20 69 74 2e 0d  |s how I did it..|
00000080  0d 31 30 4d 4f 44 45 36  20 46 61 69 72 6c 79 20  |.10MODE6 Fairly |
00000090  6f 62 76 69 6f 75 73 20  62 75 74 20 6e 65 63 65  |obvious but nece|
000000a0  73 73 61 72 79 20 62 65  63 61 75 73 65 20 73 6f  |ssary because so|
000000b0  6d 65 20 6f 66 20 74 68  65 20 0d 70 6f 73 69 74  |me of the .posit|
000000c0  69 6f 6e 69 6e 67 20 73  74 61 74 65 6d 65 6e 74  |ioning statement|
000000d0  73 20 6c 61 74 65 72 20  77 6f 75 6c 64 6e 27 74  |s later wouldn't|
000000e0  20 77 6f 72 6b 20 61 73  20 65 78 70 65 63 74 65  | work as expecte|
000000f0  64 20 69 6e 20 0d 61 6e  6f 74 68 65 72 20 6d 6f  |d in .another mo|
00000100  64 65 2e 20 54 72 79 20  63 68 61 6e 67 69 6e 67  |de. Try changing|
00000110  20 74 68 65 20 4d 4f 44  45 20 74 6f 20 73 61 79  | the MODE to say|
00000120  20 4d 4f 44 45 32 20 74  6f 20 73 65 65 20 77 68  | MODE2 to see wh|
00000130  61 74 20 0d 49 20 6d 65  61 6e 2e 0d 0d 32 30 43  |at .I mean...20C|
00000140  4c 53 20 54 68 69 73 20  6d 61 6b 65 73 20 73 75  |LS This makes su|
00000150  72 65 20 74 68 61 74 20  74 68 65 20 73 63 72 65  |re that the scre|
00000160  65 6e 20 69 73 20 63 6c  65 61 72 20 62 65 66 6f  |en is clear befo|
00000170  72 65 20 0d 73 74 61 72  74 69 6e 67 2e 20 41 67  |re .starting. Ag|
00000180  61 69 6e 20 72 65 6d 6f  76 65 20 74 68 69 73 20  |ain remove this |
00000190  6c 69 6e 65 20 74 6f 20  73 65 65 20 74 68 65 20  |line to see the |
000001a0  65 66 66 65 63 74 2e 0d  0d 33 30 56 44 55 32 33  |effect...30VDU23|
000001b0  2c 31 2c 30 3b 30 3b 30  3b 30 3b 20 54 68 69 73  |,1,0;0;0;0; This|
000001c0  20 74 75 72 6e 73 20 6f  66 66 20 74 68 65 20 66  | turns off the f|
000001d0  6c 61 73 68 69 6e 67 20  63 75 72 73 6f 72 2e 0d  |lashing cursor..|
000001e0  0d 34 30 50 52 49 4e 54  54 41 42 28 31 31 2c 34  |.40PRINTTAB(11,4|
000001f0  29 22 4e 45 57 53 2c 20  20 20 4f 50 49 4e 49 4f  |)"NEWS,   OPINIO|
00000200  4e 53 2c 22 20 0d 35 30  50 52 49 4e 54 54 41 42  |NS," .50PRINTTAB|
00000210  28 31 33 2c 36 29 22 50  52 4f 47 52 41 4d 4d 49  |(13,6)"PROGRAMMI|
00000220  4e 47 22 20 0d 36 30 50  52 49 4e 54 54 41 42 28  |NG" .60PRINTTAB(|
00000230  31 32 2c 38 29 22 49 54  27 53 20 59 4f 55 52 20  |12,8)"IT'S YOUR |
00000240  45 55 47 22 20 20 0d 54  68 65 73 65 20 6c 69 6e  |EUG"  .These lin|
00000250  65 73 20 70 72 69 6e 74  20 74 68 65 20 68 65 61  |es print the hea|
00000260  64 69 6e 67 20 73 74 61  74 65 6d 65 6e 74 2e 20  |ding statement. |
00000270  54 68 65 20 54 41 42 28  69 69 2c 64 64 29 20 0d  |The TAB(ii,dd) .|
00000280  61 66 74 65 72 20 50 52  49 4e 54 20 6d 61 6b 65  |after PRINT make|
00000290  73 20 73 75 72 65 20 74  68 61 74 20 74 68 65 20  |s sure that the |
000002a0  77 6f 72 64 73 20 61 72  65 20 70 72 69 6e 74 65  |words are printe|
000002b0  64 20 69 6e 20 0d 70 61  72 74 69 63 75 6c 61 72  |d in .particular|
000002c0  20 70 6f 73 69 74 69 6f  6e 73 2e 20 69 69 20 69  | positions. ii i|
000002d0  73 20 74 68 65 20 70 6f  73 69 74 69 6f 6e 20 69  |s the position i|
000002e0  6e 20 66 72 6f 6d 20 74  68 65 20 6c 65 66 74 20  |n from the left |
000002f0  0d 68 61 6e 64 20 73 69  64 65 20 77 68 69 6c 65  |.hand side while|
00000300  20 74 68 65 20 64 64 20  69 73 20 74 68 65 20 70  | the dd is the p|
00000310  6f 73 69 74 69 6f 6e 20  64 6f 77 6e 20 66 72 6f  |osition down fro|
00000320  6d 20 74 68 65 20 74 6f  70 20 6f 66 20 0d 74 68  |m the top of .th|
00000330  65 20 73 63 72 65 65 6e  2e 0d 0d 37 30 42 25 3d  |e screen...70B%=|
00000340  31 30 30 30 30 20 54 68  69 73 20 69 73 20 61 20  |10000 This is a |
00000350  76 61 72 69 61 62 6c 65  2c 20 61 6e 20 69 6e 74  |variable, an int|
00000360  65 67 65 72 20 20 76 61  72 69 61 62 6c 65 20 69  |eger  variable i|
00000370  6e 66 61 63 74 2e 0d 41  6e 20 69 6e 74 65 67 65  |nfact..An intege|
00000380  72 20 76 61 72 69 61 62  6c 65 20 63 61 6e 20 68  |r variable can h|
00000390  6f 6c 64 20 61 6e 79 20  77 68 6f 6c 65 20 6e 75  |old any whole nu|
000003a0  6d 62 65 72 2e 20 49 20  75 73 65 64 20 74 68 69  |mber. I used thi|
000003b0  73 20 0d 62 65 63 61 75  73 65 20 49 20 10 6e 65  |s .because I .ne|
000003c0  65 64 65 64 20 61 20 6e  75 6d 62 65 72 20 20 6c  |eded a number  l|
000003d0  61 74 65 72 20 6f 6e 20  66 6f 72 20 74 68 65 20  |ater on for the |
000003e0  63 6f 6d 70 75 74 65 72  20 74 6f 20 0d 63 6f 75  |computer to .cou|
000003f0  6e 74 20 75 70 20 74 6f  20 62 65 66 6f 72 65 20  |nt up to before |
00000400  69 74 20 10 64 69 64 20  73 6f 6d 65 74 68 69 6e  |it .did somethin|
00000410  67 2c 20 72 61 74 68 65  72 20 6c 69 6b 65 20 63  |g, rather like c|
00000420  6f 75 6e 74 69 6e 67 20  0d 75 70 20 74 6f 20 31  |ounting .up to 1|
00000430  30 30 20 77 68 65 6e 20  79 6f 75 20 70 6c 61 79  |00 when you play|
00000440  20 68 69 64 65 20 61 6e  64 20 10 73 65 65 6b 2c  | hide and .seek,|
00000450  20 79 6f 75 20 64 6f 20  70 6c 61 79 20 64 6f 6e  | you do play don|
00000460  27 74 20 0d 79 6f 75 3f  0d 0d 38 30 46 4f 52 20  |'t .you?..80FOR |
00000470  41 3d 20 31 54 4f 20 38  20 54 68 69 73 20 6c 69  |A= 1TO 8 This li|
00000480  6e 65 20 73 74 61 72 74  73 20 77 68 61 74 20 69  |ne starts what i|
00000490  73 20 6b 6e 6f 77 6e 20  61 73 20 61 20 46 4f 52  |s known as a FOR|
000004a0  20 4e 45 58 54 20 0d 6c  6f 6f 70 2e 20 4e 6f 77  | NEXT .loop. Now|
000004b0  20 69 74 20 73 61 79 73  20 27 74 68 65 72 65 20  | it says 'there |
000004c0  69 73 20 61 20 76 61 72  69 61 62 6c 65 20 63 61  |is a variable ca|
000004d0  6c 6c 65 64 20 41 2e 20  54 68 69 73 20 0d 76 61  |lled A. This .va|
000004e0  72 69 61 62 6c 65 20 69  73 20 69 6e 69 74 69 61  |riable is initia|
000004f0  6c 6c 79 20 65 71 75 61  6c 20 74 6f 20 31 2e 20  |lly equal to 1. |
00000500  54 68 65 20 66 6f 6c 6c  6f 77 69 6e 67 20 6c 69  |The following li|
00000510  6e 65 73 20 73 68 6f 75  6c 64 20 0d 62 65 20 65  |nes should .be e|
00000520  78 65 63 75 74 65 64 20  62 79 20 74 68 65 20 63  |xecuted by the c|
00000530  6f 6d 70 75 74 65 72 20  69 6e 20 74 68 65 20 6e  |omputer in the n|
00000540  6f 72 6d 61 6c 20 77 61  79 20 75 6e 74 69 6c 20  |ormal way until |
00000550  74 68 65 20 0d 63 6f 6d  70 75 74 65 72 20 66 69  |the .computer fi|
00000560  6e 64 73 20 61 6e 20 69  6e 73 74 72 75 63 74 69  |nds an instructi|
00000570  6f 6e 20 4e 45 58 54 20  41 2e 20 41 74 20 74 68  |on NEXT A. At th|
00000580  69 73 20 70 6f 69 6e 74  20 41 20 77 69 6c 6c 20  |is point A will |
00000590  0d 65 71 75 61 6c 20 32  20 61 6e 64 20 74 68 65  |.equal 2 and the|
000005a0  20 63 6f 6d 70 75 74 65  72 20 73 68 6f 75 6c 64  | computer should|
000005b0  20 72 65 74 75 72 6e 20  74 6f 20 74 68 65 20 6c  | return to the l|
000005c0  69 6e 65 20 64 65 66 69  6e 69 6e 67 20 0d 74 68  |ine defining .th|
000005d0  65 20 73 74 61 72 74 20  6f 66 20 74 68 65 20 46  |e start of the F|
000005e0  4f 52 20 4e 45 58 54 20  6c 6f 6f 70 2c 20 69 6e  |OR NEXT loop, in|
000005f0  20 74 68 69 73 20 63 61  73 65 20 6c 69 6e 65 20  | this case line |
00000600  38 30 20 61 6e 64 20 0d  74 68 65 6e 20 65 78 65  |80 and .then exe|
00000610  63 75 74 65 20 61 6c 6c  20 74 68 65 20 69 6e 73  |cute all the ins|
00000620  74 72 75 63 74 69 6f 6e  73 20 61 67 61 69 6e 2e  |tructions again.|
00000630  27 20 49 74 20 77 69 6c  6c 20 63 6f 6e 74 69 6e  |' It will contin|
00000640  75 65 20 74 6f 20 0d 64  6f 20 74 68 69 73 20 61  |ue to .do this a|
00000650  64 64 69 6e 67 20 31 20  74 6f 20 41 20 65 61 63  |dding 1 to A eac|
00000660  68 20 74 69 6d 65 20 75  6e 74 69 6c 6c 20 41 20  |h time untill A |
00000670  3d 20 38 20 77 68 65 6e  20 69 74 20 77 69 6c 6c  |= 8 when it will|
00000680  20 0d 6c 65 61 76 65 20  74 68 65 20 6c 6f 6f 70  | .leave the loop|
00000690  20 61 6e 64 20 73 74 61  72 74 20 65 78 65 63 75  | and start execu|
000006a0  74 69 6e 67 20 61 6e 79  20 69 6e 73 74 72 75 63  |ting any instruc|
000006b0  74 69 6f 6e 73 20 61 66  74 65 72 20 0d 74 68 65  |tions after .the|
000006c0  20 4e 45 58 54 20 41 20  63 6f 6d 6d 61 6e 64 2e  | NEXT A command.|
000006d0  0d 0d 49 66 20 79 6f 75  20 74 79 70 65 20 69 6e  |..If you type in|
000006e0  20 31 30 46 4f 52 20 41  3d 20 31 20 54 4f 20 31  | 10FOR A= 1 TO 1|
000006f0  30 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0.              |
00000700  20 32 30 50 52 49 4e 54  22 45 55 47 22 41 0d 20  | 20PRINT"EUG"A. |
00000710  20 20 20 20 20 20 20 20  20 20 20 20 20 20 33 30  |              30|
00000720  4e 45 58 54 20 41 0d 20  20 20 20 20 20 20 20 20  |NEXT A.         |
00000730  20 20 20 20 20 20 34 30  50 52 49 4e 54 22 44 6f  |      40PRINT"Do|
00000740  6e 65 22 0d 0d 74 68 65  6e 20 52 55 4e 20 74 68  |ne"..then RUN th|
00000750  69 73 20 79 6f 75 20 77  69 6c 6c 20 73 65 65 20  |is you will see |
00000760  45 55 47 20 70 72 69 6e  74 65 64 20 6f 6e 20 74  |EUG printed on t|
00000770  68 65 20 73 63 72 65 65  6e 20 31 30 20 0d 74 69  |he screen 10 .ti|
00000780  6d 65 73 2e 20 41 66 74  65 72 20 45 55 47 20 77  |mes. After EUG w|
00000790  69 6c 6c 20 62 65 20 77  72 69 74 74 65 6e 20 61  |ill be written a|
000007a0  20 6e 75 6d 62 65 72 20  65 71 75 61 6c 20 74 6f  | number equal to|
000007b0  20 41 20 73 6f 20 74 68  61 74 20 0d 79 6f 75 20  | A so that .you |
000007c0  10 77 69 6c 6c 20 10 68  61 76 65 20 10 61 20 10  |.will .have .a .|
000007d0  73 65 71 75 65 6e 63 65  20 10 6f 66 20 10 45 55  |sequence .of .EU|
000007e0  47 27 73 2e 20 4c 69 6e  65 20 34 30 20 77 69 6c  |G's. Line 40 wil|
000007f0  6c 20 6e 6f 74 20 62 65  20 0d 65 78 65 63 75 74  |l not be .execut|
00000800  65 64 20 10 75 6e 74 69  6c 6c 20 10 74 68 65 20  |ed .untill .the |
00000810  10 46 4f 52 20 10 4e 45  58 54 20 6c 6f 6f 70 20  |.FOR .NEXT loop |
00000820  68 61 73 20 66 69 6e 69  73 68 65 64 20 73 6f 20  |has finished so |
00000830  69 74 20 77 69 6c 6c 0d  6f 6e 6c 79 20 62 65 20  |it will.only be |
00000840  70 72 69 6e 74 65 64 20  6f 6e 63 65 20 61 74 20  |printed once at |
00000850  74 68 65 20 65 6e 64 20  6f 66 20 74 68 65 20 70  |the end of the p|
00000860  72 6f 67 72 61 6d 2e 0d  0d 54 68 65 20 46 4f 52  |rogram...The FOR|
00000870  20 4e 45 58 54 20 6c 6f  6f 70 20 69 73 20 6f 6e  | NEXT loop is on|
00000880  65 20 6f 66 20 74 68 65  20 6d 6f 73 74 20 66 75  |e of the most fu|
00000890  6e 64 61 6d 65 6e 74 61  6c 20 63 6f 6d 6d 61 6e  |ndamental comman|
000008a0  64 73 20 69 6e 20 0d 42  41 53 49 43 2e 20 49 6e  |ds in .BASIC. In|
000008b0  64 65 65 64 20 6c 6f 6f  70 73 20 73 69 6d 69 6c  |deed loops simil|
000008c0  61 72 20 74 6f 20 74 68  69 73 20 61 72 65 20 74  |ar to this are t|
000008d0  68 65 20 6d 6f 73 74 20  66 75 6e 64 65 6d 65 6e  |he most fundemen|
000008e0  74 61 6c 20 0d 63 6f 6d  6d 61 6e 64 73 20 6f 6e  |tal .commands on|
000008f0  20 61 6e 79 20 63 6f 6d  70 75 74 65 72 20 69 6e  | any computer in|
00000900  63 6c 75 64 69 6e 67 20  6d 75 6c 74 69 2d 6d 69  |cluding multi-mi|
00000910  6c 6c 69 6f 6e 20 70 6f  75 6e 64 20 0d 6d 61 63  |llion pound .mac|
00000920  68 69 6e 65 73 2e 0d 0d  39 30 52 45 41 44 20 41  |hines...90READ A|
00000930  24 20 54 68 65 20 52 45  41 44 20 63 6f 6d 6d 61  |$ The READ comma|
00000940  6e 64 20 74 65 6c 6c 73  20 74 68 65 20 63 6f 6d  |nd tells the com|
00000950  70 75 74 65 72 20 74 6f  20 6c 6f 6f 6b 20 69 6e  |puter to look in|
00000960  74 6f 20 0d 44 41 54 41  20 73 74 61 74 65 6d 65  |to .DATA stateme|
00000970  6e 74 73 2c 20 61 6e 64  20 77 68 61 74 20 65 76  |nts, and what ev|
00000980  65 72 20 69 73 20 69 6e  20 74 68 65 72 65 20 74  |er is in there t|
00000990  6f 20 70 75 74 20 74 68  69 73 20 69 6e 74 6f 20  |o put this into |
000009a0  0d 74 68 65 20 76 61 72  69 61 62 6c 65 20 66 6f  |.the variable fo|
000009b0  6c 6c 6f 77 69 6e 67 20  74 68 65 20 52 45 41 44  |llowing the READ|
000009c0  20 63 6f 6d 6d 61 6e 64  2e 20 49 6e 20 74 68 69  | command. In thi|
000009d0  73 20 63 61 73 65 20 74  68 65 20 0d 44 41 54 41  |s case the .DATA|
000009e0  20 73 74 61 74 65 6d 65  6e 74 73 20 68 61 76 65  | statements have|
000009f0  20 74 65 78 74 20 69 6e  20 74 68 65 6d 20 73 6f  | text in them so|
00000a00  20 74 68 65 20 76 61 72  69 61 62 6c 65 20 69 73  | the variable is|
00000a10  20 41 24 20 74 68 65 20  0d 24 20 69 73 20 70 72  | A$ the .$ is pr|
00000a20  6f 6e 6f 75 6e 63 65 64  20 64 6f 6c 6c 61 72 2e  |onounced dollar.|
00000a30  20 41 20 24 20 76 61 72  69 61 62 6c 65 20 69 73  | A $ variable is|
00000a40  20 75 73 65 64 20 66 6f  72 20 74 65 78 74 20 61  | used for text a|
00000a50  6e 64 20 69 73 20 10 0d  6d 6f 72 65 20 70 72 6f  |nd is ..more pro|
00000a60  70 65 72 6c 79 20 63 61  6c 6c 65 64 20 61 20 73  |perly called a s|
00000a70  74 72 69 6e 67 20 76 61  72 69 61 62 6c 65 20 73  |tring variable s|
00000a80  69 6e 63 65 20 61 20 73  65 71 75 65 6e 63 65 20  |ince a sequence |
00000a90  6f 66 0d 74 65 78 74 20  69 73 20 6b 6e 6f 77 6e  |of.text is known|
00000aa0  20 61 73 20 61 20 73 74  72 69 6e 67 20 20 20 20  | as a string    |
00000ab0  0d 25 2c 20 70 72 6f 6e  6f 75 6e 63 65 64 20 70  |.%, pronounced p|
00000ac0  65 72 63 65 6e 74 2c 20  10 76 61 72 69 61 62 6c  |ercent, .variabl|
00000ad0  65 20 69 73 20 75 73 65  64 20 66 6f 72 20 77 68  |e is used for wh|
00000ae0  6f 6c 65 20 6e 75 6d 62  65 72 73 2e 20 20 0d 25  |ole numbers.  .%|
00000af0  20 76 61 72 69 61 62 6c  65 20 69 73 20 10 70 72  | variable is .pr|
00000b00  6f 70 65 72 6c 79 20 63  61 6c 6c 65 64 20 61 6e  |operly called an|
00000b10  20 69 6e 74 65 72 67 65  72 20 76 61 72 69 61 62  | interger variab|
00000b20  6c 65 2e 20 0d 41 20 76  61 72 69 61 62 6c 65 20  |le. .A variable |
00000b30  77 69 74 68 6f 75 74 20  61 20 10 73 69 67 6e 20  |without a .sign |
00000b40  69 73 20 63 61 6c 6c 65  64 20 61 20 72 65 61 6c  |is called a real|
00000b50  20 76 61 72 69 61 62 6c  65 20 61 6e 64 20 0d 63  | variable and .c|
00000b60  61 6e 20 62 65 20 75 73  65 64 20 66 6f 72 20 77  |an be used for w|
00000b70  68 6f 6c 65 20 10 6e 75  6d 62 65 72 73 20 61 6e  |hole .numbers an|
00000b80  64 20 66 72 61 63 74 69  6f 6e 73 2e 20 0d 49 20  |d fractions. .I |
00000b90  75 73 65 64 20 72 65 61  6c 20 76 61 72 69 61 62  |used real variab|
00000ba0  6c 65 73 20 73 69 6d 70  6c 79 20 74 6f 20 10 73  |les simply to .s|
00000bb0  61 76 65 20 73 6f 6d 65  20 74 69 6d 65 20 74 79  |ave some time ty|
00000bc0  70 69 6e 67 20 62 75 74  20 0d 73 6f 6d 65 74 69  |ping but .someti|
00000bd0  6d 65 73 20 69 74 20 69  73 20 6e 65 63 65 73 73  |mes it is necess|
00000be0  61 72 79 20 74 6f 20 75  73 65 20 10 61 6e 20 69  |ary to use .an i|
00000bf0  6e 74 65 67 65 72 20 76  61 72 69 61 62 6c 65 20  |nteger variable |
00000c00  66 6f 72 20 0d 65 78 61  6d 70 6c 65 20 77 68 65  |for .example whe|
00000c10  6e 20 74 68 65 20 63 6f  75 6e 74 69 6e 67 20 69  |n the counting i|
00000c20  6e 20 74 68 65 20 10 46  4f 52 20 4e 45 58 54 20  |n the .FOR NEXT |
00000c30  6c 6f 6f 70 20 6d 69 67  68 74 20 0d 70 72 6f 64  |loop might .prod|
00000c40  75 63 65 20 61 20 66 72  61 63 74 69 6f 6e 20 77  |uce a fraction w|
00000c50  68 69 63 68 20 79 6f 75  20 77 61 6e 74 20 74 68  |hich you want th|
00000c60  65 20 10 63 6f 6d 70 75  74 65 72 20 74 6f 20 69  |e .computer to i|
00000c70  67 6e 6f 72 65 2e 20 0d  54 68 65 20 66 69 72 73  |gnore. .The firs|
00000c80  74 20 44 41 54 41 20 73  74 61 74 65 6d 65 6e 74  |t DATA statement|
00000c90  20 69 73 20 72 65 61 64  20 6f 6e 20 10 74 68 65  | is read on .the|
00000ca0  20 66 69 72 73 74 20 70  61 73 73 20 6f 66 20 74  | first pass of t|
00000cb0  68 65 20 0d 6c 6f 6f 70  2c 20 6f 6e 20 74 68 65  |he .loop, on the|
00000cc0  20 73 65 63 6f 6e 64 20  70 61 73 73 20 74 68 65  | second pass the|
00000cd0  20 73 65 63 6f 6e 64 20  10 44 41 54 41 20 73 74  | second .DATA st|
00000ce0  61 74 65 6d 65 6e 74 20  69 73 20 72 65 61 64 20  |atement is read |
00000cf0  0d 61 6e 20 73 6f 20 6f  6e 2e 0d 0d 31 30 30 50  |.an so on...100P|
00000d00  52 49 4e 54 54 41 42 28  31 2c 31 32 29 41 24 20  |RINTTAB(1,12)A$ |
00000d10  54 68 69 73 20 73 69 6d  70 6c 79 20 74 65 6c 6c  |This simply tell|
00000d20  73 20 74 68 65 20 63 6f  6d 70 75 74 65 72 20 74  |s the computer t|
00000d30  6f 20 70 72 69 6e 74 20  0d 41 24 20 77 68 61 74  |o print .A$ what|
00000d40  65 76 65 72 20 69 74 20  68 61 70 70 65 6e 73 20  |ever it happens |
00000d50  74 6f 20 62 65 20 61 74  20 74 68 61 74 20 74 69  |to be at that ti|
00000d60  6d 65 20 69 6e 20 61 20  70 61 72 74 69 63 75 6c  |me in a particul|
00000d70  61 72 20 0d 70 6f 73 69  74 69 6f 6e 2e 0d 0d 31  |ar .position...1|
00000d80  31 30 50 52 49 4e 54 54  41 42 28 31 2c 31 39 29  |10PRINTTAB(1,19)|
00000d90  22 20 54 68 69 73 20 6c  69 6e 65 20 77 6f 75 6c  |" This line woul|
00000da0  64 20 6f 66 66 65 6e 64  20 6d 6f 73 74 20 42 41  |d offend most BA|
00000db0  53 49 43 20 0d 70 72 6f  67 72 61 6d 6d 65 72 73  |SIC .programmers|
00000dc0  2e 20 49 74 20 70 72 69  6e 74 73 20 61 20 62 6c  |. It prints a bl|
00000dd0  61 6e 6b 20 6c 69 6e 65  20 69 6e 20 61 20 70 61  |ank line in a pa|
00000de0  72 74 69 63 75 6c 61 72  20 70 6f 73 69 74 69 6f  |rticular positio|
00000df0  6e 20 0d 77 68 69 63 68  20 10 69 73 20 10 75 73  |n .which .is .us|
00000e00  65 64 20 10 66 75 72 74  68 65 72 20 10 64 6f 77  |ed .further .dow|
00000e10  6e 20 10 74 68 65 20 10  70 72 6f 67 72 61 6d 2e  |n .the .program.|
00000e20  20 10 53 6f 20 10 77 68  65 6e 20 74 68 69 73 20  | .So .when this |
00000e30  0d 70 6f 73 69 74 69 6f  6e 20 68 61 73 20 73 6f  |.position has so|
00000e40  6d 65 74 68 69 6e 67 20  77 72 69 74 74 65 6e 20  |mething written |
00000e50  6f 6e 74 6f 20 69 74 20  6c 61 74 65 72 20 6f 6e  |onto it later on|
00000e60  20 69 6e 20 74 68 65 20  0d 70 72 6f 67 72 61 6d  | in the .program|
00000e70  2c 20 74 68 65 20 6c 6f  6f 70 20 63 79 63 6c 65  |, the loop cycle|
00000e80  73 20 61 72 6f 75 6e 64  20 61 6e 64 20 65 78 65  |s around and exe|
00000e90  63 75 74 65 73 20 74 68  69 73 20 6c 69 6e 65 20  |cutes this line |
00000ea0  61 67 61 69 6e 0d 61 6e  64 20 74 68 69 73 20 6c  |again.and this l|
00000eb0  69 6e 65 20 65 66 66 65  63 74 69 76 6c 79 20 65  |ine effectivly e|
00000ec0  72 61 73 65 73 20 74 68  69 73 20 70 6f 73 69 74  |rases this posit|
00000ed0  69 6f 6e 2e 0d 54 68 65  72 65 20 61 72 65 20 6d  |ion..There are m|
00000ee0  6f 72 65 20 65 6c 65 67  61 6e 74 20 77 61 79 73  |ore elegant ways|
00000ef0  20 6f 66 20 64 6f 69 6e  67 20 10 74 68 69 73 20  | of doing .this |
00000f00  62 75 74 20 74 68 69 73  20 77 6f 72 6b 73 20 0d  |but this works .|
00000f10  71 75 69 74 65 20 77 65  6c 6c 20 61 6e 64 2e 2e  |quite well and..|
00000f20  2e 2e 2e 0d 0d 31 32 30  46 4f 52 54 25 3d 31 20  |.....120FORT%=1 |
00000f30  54 4f 20 42 25 20 54 68  69 73 20 69 73 20 61 6e  |TO B% This is an|
00000f40  6f 74 68 65 72 20 46 4f  52 20 4e 45 58 54 20 6c  |other FOR NEXT l|
00000f50  6f 6f 70 2e 20 54 68 69  73 20 74 69 6d 65 20 0d  |oop. This time .|
00000f60  69 74 73 20 70 75 72 70  6f 73 65 20 69 73 20 73  |its purpose is s|
00000f70  69 6d 70 6c 79 20 74 6f  20 6d 61 6b 65 20 74 68  |imply to make th|
00000f80  65 20 63 6f 6d 70 75 74  65 72 20 77 61 69 74 20  |e computer wait |
00000f90  66 6f 72 20 61 20 77 68  69 6c 65 20 0d 62 65 66  |for a while .bef|
00000fa0  6f 72 65 20 65 78 65 63  75 74 69 6e 67 20 74 68  |ore executing th|
00000fb0  65 20 6e 65 78 74 20 69  6e 73 74 72 75 63 74 69  |e next instructi|
00000fc0  6f 6e 20 62 65 63 61 75  73 65 20 69 74 20 68 61  |on because it ha|
00000fd0  73 20 74 6f 20 0d 63 6f  75 6e 74 20 75 70 20 74  |s to .count up t|
00000fe0  6f 20 31 30 30 30 30 20  77 68 69 63 68 20 69 73  |o 10000 which is|
00000ff0  20 77 68 61 74 20 42 25  20 69 73 20 65 71 75 61  | what B% is equa|
00001000  6c 20 74 6f 2e 20 49 6e  20 74 68 69 73 20 0d 63  |l to. In this .c|
00001010  61 73 65 20 69 74 73 20  70 75 72 70 6f 73 65 20  |ase its purpose |
00001020  69 73 20 74 6f 20 6d 61  6b 65 20 73 6f 6d 65 20  |is to make some |
00001030  74 69 6d 65 20 74 6f 20  72 65 61 64 20 41 24 20  |time to read A$ |
00001040  66 72 6f 6d 20 6c 69 6e  65 20 0d 31 30 30 2e 20  |from line .100. |
00001050  41 67 61 69 6e 20 10 74  68 65 72 65 20 61 72 65  |Again .there are|
00001060  20 6d 6f 72 65 20 65 6c  65 67 61 6e 74 20 77 61  | more elegant wa|
00001070  79 73 20 74 6f 20 64 6f  20 74 68 69 73 20 62 75  |ys to do this bu|
00001080  74 2e 2e 2e 2e 0d 0d 54  68 65 20 76 61 72 69 61  |t......The varia|
00001090  62 6c 65 20 42 25 20 69  73 20 75 73 65 64 20 62  |ble B% is used b|
000010a0  65 63 61 75 73 65 20 77  68 65 6e 20 49 20 77 61  |ecause when I wa|
000010b0  73 20 64 65 76 65 6c 6f  70 69 6e 67 20 74 68 65  |s developing the|
000010c0  20 0d 70 72 6f 67 72 61  6d 20 49 20 77 61 6e 74  | .program I want|
000010d0  65 64 20 74 6f 20 6d 61  6b 65 20 69 74 20 72 75  |ed to make it ru|
000010e0  6e 20 71 75 69 74 65 20  66 61 73 74 2e 20 49 20  |n quite fast. I |
000010f0  64 69 64 6e 27 74 20 6e  65 65 64 20 74 6f 20 0d  |didn't need to .|
00001100  72 65 61 64 20 41 24 20  73 69 6e 63 65 20 49 20  |read A$ since I |
00001110  68 61 64 20 77 72 69 74  74 65 6e 20 41 24 2e 20  |had written A$. |
00001120  44 75 72 69 6e 67 20 64  65 76 65 6c 6f 70 6d 65  |During developme|
00001130  6e 74 20 49 20 77 61 73  20 0d 73 65 74 74 69 6e  |nt I was .settin|
00001140  67 20 42 25 20 74 6f 20  31 30 30 2e 54 68 69 73  |g B% to 100.This|
00001150  20 74 72 69 63 6b 20 69  73 20 75 73 65 64 20 61  | trick is used a|
00001160  67 61 69 6e 20 10 6c 61  74 65 72 20 6f 6e 20 73  |gain .later on s|
00001170  6f 20 0d 74 68 61 74 20  64 65 6c 61 79 73 20 61  |o .that delays a|
00001180  72 65 20 61 6c 6c 20 6f  66 20 74 68 65 20 73 61  |re all of the sa|
00001190  6d 65 20 6c 65 6e 67 74  68 2e 0d 0d 31 33 30 4e  |me length...130N|
000011a0  45 58 54 54 25 20 53 65  65 20 61 62 6f 76 65 2e  |EXTT% See above.|
000011b0  0d 0d 31 34 30 52 45 41  44 20 42 24 20 54 68 69  |..140READ B$ Thi|
000011c0  73 20 69 73 20 65 78 61  63 74 6c 79 20 74 68 65  |s is exactly the|
000011d0  20 73 61 6d 65 20 61 73  20 74 68 65 20 52 45 41  | same as the REA|
000011e0  44 20 41 24 2e 20 42 75  74 20 69 6e 20 0d 74 68  |D A$. But in .th|
000011f0  69 73 20 63 61 73 65 20  69 74 20 77 69 6c 6c 20  |is case it will |
00001200  62 65 20 74 68 65 20 6e  65 78 74 20 44 41 54 41  |be the next DATA|
00001210  20 73 74 61 74 65 6d 65  6e 74 20 64 6f 77 6e 2e  | statement down.|
00001220  0d 0d 31 35 30 50 52 49  4e 54 54 41 42 28 31 2c  |..150PRINTTAB(1,|
00001230  31 39 29 42 24 20 41 67  61 69 6e 20 74 68 65 20  |19)B$ Again the |
00001240  73 61 6d 65 20 61 73 20  6c 69 6e 65 20 31 30 30  |same as line 100|
00001250  20 62 75 74 20 6e 6f 74  69 63 65 20 0d 74 68 61  | but notice .tha|
00001260  74 20 74 68 65 20 70 6f  73 69 74 69 6f 6e 20 66  |t the position f|
00001270  6f 72 20 70 72 69 6e 74  69 6e 67 20 69 73 20 64  |or printing is d|
00001280  69 66 66 65 72 65 6e 74  2e 0d 0d 31 36 30 50 52  |ifferent...160PR|
00001290  49 4e 54 54 41 42 28 31  2c 31 32 29 22 20 54 68  |INTTAB(1,12)" Th|
000012a0  69 73 20 70 75 74 73 20  61 20 62 6c 61 6e 6b 20  |is puts a blank |
000012b0  6c 69 6e 65 20 69 6e 20  74 68 65 20 70 6f 73 69  |line in the posi|
000012c0  74 69 6f 6e 20 0d 77 68  65 72 65 20 41 24 20 77  |tion .where A$ w|
000012d0  61 73 20 70 72 69 6e 74  65 64 2e 20 41 24 20 69  |as printed. A$ i|
000012e0  73 20 65 72 61 73 65 64  20 61 6e 64 20 73 6f 20  |s erased and so |
000012f0  42 24 20 6c 6f 6f 6b 73  20 6c 69 6b 65 20 61 20  |B$ looks like a |
00001300  0d 72 65 70 6c 79 20 74  6f 20 41 24 2e 0d 0d 31  |.reply to A$...1|
00001310  37 30 46 4f 52 54 25 3d  31 20 54 4f 20 42 25 0d  |70FORT%=1 TO B%.|
00001320  31 38 30 4e 45 58 54 54  25 20 20 20 20 20 20 20  |180NEXTT%       |
00001330  20 54 68 69 73 20 69 73  20 61 6e 20 69 64 65 6e  | This is an iden|
00001340  74 69 63 61 6c 20 64 65  6c 61 79 20 74 6f 20 6c  |tical delay to l|
00001350  69 6e 65 73 20 31 32 30  20 0d 61 6e 64 20 31 33  |ines 120 .and 13|
00001360  30 0d 0d 31 39 30 4e 45  58 54 20 41 20 54 68 69  |0..190NEXT A Thi|
00001370  73 20 69 73 20 74 68 65  20 65 6e 64 20 6f 66 20  |s is the end of |
00001380  74 68 65 20 6f 72 69 67  69 6e 61 6c 20 46 4f 52  |the original FOR|
00001390  20 4e 45 58 54 20 6c 6f  6f 70 2e 20 74 68 65 20  | NEXT loop. the |
000013a0  0d 63 6f 6d 70 75 74 65  72 20 77 69 6c 6c 20 61  |.computer will a|
000013b0  64 64 20 6f 6e 65 20 74  6f 20 41 20 61 6e 64 20  |dd one to A and |
000013c0  74 68 65 6e 20 67 6f 20  62 61 63 6b 20 74 6f 20  |then go back to |
000013d0  6c 69 6e 65 20 38 30 20  74 6f 20 0d 6c 6f 6f 70  |line 80 to .loop|
000013e0  20 74 68 72 6f 75 67 68  20 74 68 65 20 69 6e 73  | through the ins|
000013f0  74 72 75 63 74 69 6f 6e  73 20 61 67 61 69 6e 20  |tructions again |
00001400  75 6e 74 69 6c 20 6f 66  20 63 6f 75 72 73 65 20  |until of course |
00001410  41 20 3d 20 38 0d                                 |A = 8.|
00001416
F/Scren1.m0
F/Scren1.m1
F/Scren1.m2
F/Scren1.m4
F/Scren1.m5