Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_53.ADF » V/+INDIRE
V/+INDIRE
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_53.ADF |
Filename: | V/+INDIRE |
Read OK: | ✔ |
File size: | 185E bytes |
Load address: | 56204556 |
Exec address: | 4E492B2E |
Duplicates
There are 2 duplicate copies of this file in the archive:
- AEW website » eug » eug_3_5_discs_Eug-53_A-EUG53.adf » V/+INDIRE
- AEW website » eug » eug_5_25_discs_Eug-53_D-EUG53.dsd » V.+INDIRE
- Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_53.ADF » V/+INDIRE
File contents
FASTER PROGRAMMING USING INDIRECTION OPERATORS By C. E. H. Francis IF you have tried writing anything but the most simple Basic game, the chances are that you will have tried using arrays. This causes two problems: arrays use up a lot of memory, and they are relatively slow. Fortunately, both problems can be solved without resorting to machine code by the use of the so-called INDIRECTION OPERATORS provided by BBC Basic. The full description of indirection operators lies in the part of the manual that most of us don't read (pages 129, 130 and the section on assembly language programming), but in fact they are remarkably easy to use. An indirection operator allows a Basic program to use any memory location directly; on many micros the actions involved are known as 'peeks' and 'pokes'. The simplest way to use indirection operators applies to integer arrays when it is known that all the numbers to be stored are positive integers less than 256. For example, two arrays could be used to store the X and Y co-ordinates of user defined char- acters within a game, with one for the X values, and the other for the Y values. In this case, the two arrays can be replaced directly. Consider the following short program, which loops round setting an array to a specific value: 10 DIM A%(999) 20 TIME=0 30 FOR I%=0 TO 999:A%(I%)=1:NEXT 40 PRINT TIME In Mode 6, this took 1.38 seconds on my Electron. Now replace A%(999) by A% 999 and A%?I% (? is pronounced as 'query'). With this replacement, the loop takes 1.02 seconds: a saving of 25%. This can be a very major saving in a game in which you may access a number of arrays hundreds of times whenever the main loop of the program is executed. DIM A% 999 assigns 1000 bytes of memory from A% to A%+999. To find out where in memory this might be, type PRINT A% after the above program has been run. A%?I% gives the contents of memory location A%+I%, but this could also be accessed with ?(A%+I%). This gives a clue to an even greater saving. Replace line 30 above with: 30 FOR I%=A% TO A%+999:?I%=1:NEXT This accomplishes exactly the same thing, but the program now runs in 0.92 seconds, a total saving of around 33%. This is all very well, but what if you want to use an array which takes values requiring more than one byte of memory (i.e. integers greater than 255)? The savings in time are no less dramatic using the ! (pronounced 'pling') indirection operator. The Electron stores integers in four consecutive bytes, and !I% gives the integer stored in locations I%, I%+1, I%+2 and I%+3. For an integer array with 1000 members, 4000 (1000*4) memory locations must be reserved, and the step size should be 4. Replace lines 10 and 30 with: 10 DIM A% 3999 30 FOR I%=A% TO A%+3999 STEP4:!I%=1:NEXT This is barely slower, taking 0.94 seconds. In addition, any integer value can be placed in the location I% by using !I%=<value>. String arrays can be replaced using the $ (pronounced 'string') indirection operator, and the savings are even greater. Try using 10 DIM A$(999) 30 FOR I%=0 TO 999:A$(I%)="TEST":NEXT This took 1.48 seconds on my Electron. When using indirection operators the string "TEST" requires five memory locations, one for each letter, and one for a <RETURN> to indicate the end of the string. To see how the $ indirection operator works, try altering lines 10 and 30 to: 10 DIM A% 9999 30 FOR I%=A% TO A%+4999 STEP 5:$I%="TEST":NEXT This saves over half a second, taking 0.96 seconds. Virtually no time is lost by setting aside more memory, and using a larger step size, for example DIM A% 9999 and STEP 10. The maximum length of a string which can be stored like this is one less than the step size used. Due to the way in which string arrays are allocated memory on the Electron, the savings in memory are quite significant. Incidentally, when indirection operators are used like this some of the Basic string operators can be simulated very easily. In the above examples, PRINT ?A% gives the ASCII code for T, which PRINT $(A%+1) gives EST, simulating the operation of the RIGHT$ function. The Electron simply reads the string from wherever it is told to start, and stops when it reaches a <RETURN> (ASCII value 13). LEFT$ can also be simulated by placing a <RETURN> in a particular memory location. For example $(A%+2)="" which puts a <RETURN> character at A%+2, followed by PRINT $A% will give TE. Strings can be combined by placing the first letter of one string in the location occupied by the <RETURN> for another string. For example, type S(A%+2)="STING". PRINT $A% now gives TESTING. Finally, it is worth examining the savings which can be made on using two (or more) dimensional arrays. These are even slower than one dimensional arrays. For example, type in the lines listed here: 10 DIM A%(9,99) 30 FOR K%=0 TO 9:FOR J%=0 TO 99:A%(K%,J%)=1:NEXT When run, the program now takes 2.27 seconds. Indirection operators do not allow the use of more than one dimension, so the two dimensional array above must be replaced by the one dimensional set of memory locations DIM A% 999. Then K% and J% have to be replaced by I% running from A% to A%+999. This brings the time down to 0.92 seconds, but you do have to be careful with the arithmetic. In this example, the actual location of the element A%(K%,j%) is found as follows: I%=A%+100*K%+J% So you must remember that increasing I% by one corresponds to increasing J% by one, unless the value of J% is 99, when it corresponds to increas- ing K% by 1 and resetting J% to 0. Increasing I% by 100 corresponds to increasing K% by 1 and leaving J% alone. The situation is essentially similar in the case of the ! and $ indirection operators, but then you also have to be careful about the sizes. By the way, don't succumb to the temptation of letting the micro do the arithmetic for you by using an equation such as the one above inside the FOR-NEXT loop - you will very likely lose all the time saved! C. Francis, EUG #53 'Stolen' from ELBUG Vol 1 No 10
00000000 20 20 20 20 20 20 20 20 20 20 20 20 20 46 41 53 | FAS| 00000010 54 45 52 20 50 52 4f 47 52 41 4d 4d 49 4e 47 20 |TER PROGRAMMING | 00000020 55 53 49 4e 47 20 49 4e 44 49 52 45 43 54 49 4f |USING INDIRECTIO| 00000030 4e 20 4f 50 45 52 41 54 4f 52 53 0d 20 20 20 20 |N OPERATORS. | 00000040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000050 20 20 20 20 20 20 42 79 20 43 2e 20 45 2e 20 48 | By C. E. H| 00000060 2e 20 46 72 61 6e 63 69 73 0d 0d 49 46 20 79 6f |. Francis..IF yo| 00000070 75 20 68 61 76 65 20 74 72 69 65 64 20 77 72 69 |u have tried wri| 00000080 74 69 6e 67 20 61 6e 79 74 68 69 6e 67 20 62 75 |ting anything bu| 00000090 74 20 74 68 65 20 6d 6f 73 74 20 73 69 6d 70 6c |t the most simpl| 000000a0 65 20 42 61 73 69 63 20 67 61 6d 65 2c 20 74 68 |e Basic game, th| 000000b0 65 20 0d 63 68 61 6e 63 65 73 20 61 72 65 20 74 |e .chances are t| 000000c0 68 61 74 20 79 6f 75 20 77 69 6c 6c 20 68 61 76 |hat you will hav| 000000d0 65 20 74 72 69 65 64 20 75 73 69 6e 67 20 61 72 |e tried using ar| 000000e0 72 61 79 73 2e 20 54 68 69 73 20 63 61 75 73 65 |rays. This cause| 000000f0 73 20 74 77 6f 0d 70 72 6f 62 6c 65 6d 73 3a 20 |s two.problems: | 00000100 61 72 72 61 79 73 20 75 73 65 20 75 70 20 61 20 |arrays use up a | 00000110 6c 6f 74 20 6f 66 20 6d 65 6d 6f 72 79 2c 20 61 |lot of memory, a| 00000120 6e 64 20 74 68 65 79 20 61 72 65 20 72 65 6c 61 |nd they are rela| 00000130 74 69 76 65 6c 79 20 73 6c 6f 77 2e 0d 46 6f 72 |tively slow..For| 00000140 74 75 6e 61 74 65 6c 79 2c 20 62 6f 74 68 20 70 |tunately, both p| 00000150 72 6f 62 6c 65 6d 73 20 63 61 6e 20 62 65 20 73 |roblems can be s| 00000160 6f 6c 76 65 64 20 77 69 74 68 6f 75 74 20 72 65 |olved without re| 00000170 73 6f 72 74 69 6e 67 20 74 6f 20 6d 61 63 68 69 |sorting to machi| 00000180 6e 65 0d 63 6f 64 65 20 62 79 20 74 68 65 20 75 |ne.code by the u| 00000190 73 65 20 6f 66 20 74 68 65 20 73 6f 2d 63 61 6c |se of the so-cal| 000001a0 6c 65 64 20 49 4e 44 49 52 45 43 54 49 4f 4e 20 |led INDIRECTION | 000001b0 4f 50 45 52 41 54 4f 52 53 20 70 72 6f 76 69 64 |OPERATORS provid| 000001c0 65 64 20 62 79 20 42 42 43 0d 42 61 73 69 63 2e |ed by BBC.Basic.| 000001d0 20 54 68 65 20 66 75 6c 6c 20 64 65 73 63 72 69 | The full descri| 000001e0 70 74 69 6f 6e 20 6f 66 20 69 6e 64 69 72 65 63 |ption of indirec| 000001f0 74 69 6f 6e 20 6f 70 65 72 61 74 6f 72 73 20 6c |tion operators l| 00000200 69 65 73 20 69 6e 20 74 68 65 20 70 61 72 74 20 |ies in the part | 00000210 6f 66 0d 74 68 65 20 6d 61 6e 75 61 6c 20 74 68 |of.the manual th| 00000220 61 74 20 6d 6f 73 74 20 6f 66 20 75 73 20 64 6f |at most of us do| 00000230 6e 27 74 20 72 65 61 64 20 28 70 61 67 65 73 20 |n't read (pages | 00000240 31 32 39 2c 20 31 33 30 20 61 6e 64 20 74 68 65 |129, 130 and the| 00000250 20 73 65 63 74 69 6f 6e 20 6f 6e 0d 61 73 73 65 | section on.asse| 00000260 6d 62 6c 79 20 6c 61 6e 67 75 61 67 65 20 70 72 |mbly language pr| 00000270 6f 67 72 61 6d 6d 69 6e 67 29 2c 20 62 75 74 20 |ogramming), but | 00000280 69 6e 20 66 61 63 74 20 74 68 65 79 20 61 72 65 |in fact they are| 00000290 20 72 65 6d 61 72 6b 61 62 6c 79 20 65 61 73 79 | remarkably easy| 000002a0 20 74 6f 0d 75 73 65 2e 0d 20 20 20 41 6e 20 69 | to.use.. An i| 000002b0 6e 64 69 72 65 63 74 69 6f 6e 20 6f 70 65 72 61 |ndirection opera| 000002c0 74 6f 72 20 61 6c 6c 6f 77 73 20 61 20 42 61 73 |tor allows a Bas| 000002d0 69 63 20 70 72 6f 67 72 61 6d 20 74 6f 20 75 73 |ic program to us| 000002e0 65 20 61 6e 79 20 6d 65 6d 6f 72 79 0d 6c 6f 63 |e any memory.loc| 000002f0 61 74 69 6f 6e 20 64 69 72 65 63 74 6c 79 3b 20 |ation directly; | 00000300 6f 6e 20 6d 61 6e 79 20 6d 69 63 72 6f 73 20 74 |on many micros t| 00000310 68 65 20 61 63 74 69 6f 6e 73 20 69 6e 76 6f 6c |he actions invol| 00000320 76 65 64 20 61 72 65 20 6b 6e 6f 77 6e 20 61 73 |ved are known as| 00000330 20 0d 27 70 65 65 6b 73 27 20 61 6e 64 20 27 70 | .'peeks' and 'p| 00000340 6f 6b 65 73 27 2e 20 54 68 65 20 73 69 6d 70 6c |okes'. The simpl| 00000350 65 73 74 20 77 61 79 20 74 6f 20 75 73 65 20 69 |est way to use i| 00000360 6e 64 69 72 65 63 74 69 6f 6e 20 6f 70 65 72 61 |ndirection opera| 00000370 74 6f 72 73 20 0d 61 70 70 6c 69 65 73 20 74 6f |tors .applies to| 00000380 20 69 6e 74 65 67 65 72 20 61 72 72 61 79 73 20 | integer arrays | 00000390 77 68 65 6e 20 69 74 20 69 73 20 6b 6e 6f 77 6e |when it is known| 000003a0 20 74 68 61 74 20 61 6c 6c 20 74 68 65 20 6e 75 | that all the nu| 000003b0 6d 62 65 72 73 20 74 6f 20 62 65 0d 73 74 6f 72 |mbers to be.stor| 000003c0 65 64 20 61 72 65 20 70 6f 73 69 74 69 76 65 20 |ed are positive | 000003d0 69 6e 74 65 67 65 72 73 20 6c 65 73 73 20 74 68 |integers less th| 000003e0 61 6e 20 32 35 36 2e 20 46 6f 72 20 65 78 61 6d |an 256. For exam| 000003f0 70 6c 65 2c 20 74 77 6f 20 61 72 72 61 79 73 20 |ple, two arrays | 00000400 0d 63 6f 75 6c 64 20 62 65 20 75 73 65 64 20 74 |.could be used t| 00000410 6f 20 73 74 6f 72 65 20 74 68 65 20 58 20 61 6e |o store the X an| 00000420 64 20 59 20 63 6f 2d 6f 72 64 69 6e 61 74 65 73 |d Y co-ordinates| 00000430 20 6f 66 20 75 73 65 72 20 64 65 66 69 6e 65 64 | of user defined| 00000440 20 63 68 61 72 2d 0d 61 63 74 65 72 73 20 77 69 | char-.acters wi| 00000450 74 68 69 6e 20 61 20 67 61 6d 65 2c 20 77 69 74 |thin a game, wit| 00000460 68 20 6f 6e 65 20 66 6f 72 20 74 68 65 20 58 20 |h one for the X | 00000470 76 61 6c 75 65 73 2c 20 61 6e 64 20 74 68 65 20 |values, and the | 00000480 6f 74 68 65 72 20 66 6f 72 20 74 68 65 0d 59 20 |other for the.Y | 00000490 76 61 6c 75 65 73 2e 20 49 6e 20 74 68 69 73 20 |values. In this | 000004a0 63 61 73 65 2c 20 74 68 65 20 74 77 6f 20 61 72 |case, the two ar| 000004b0 72 61 79 73 20 63 61 6e 20 62 65 20 72 65 70 6c |rays can be repl| 000004c0 61 63 65 64 20 64 69 72 65 63 74 6c 79 2e 20 0d |aced directly. .| 000004d0 43 6f 6e 73 69 64 65 72 20 74 68 65 20 66 6f 6c |Consider the fol| 000004e0 6c 6f 77 69 6e 67 20 73 68 6f 72 74 20 70 72 6f |lowing short pro| 000004f0 67 72 61 6d 2c 20 77 68 69 63 68 20 6c 6f 6f 70 |gram, which loop| 00000500 73 20 72 6f 75 6e 64 20 73 65 74 74 69 6e 67 20 |s round setting | 00000510 61 6e 20 61 72 72 61 79 0d 74 6f 20 61 20 73 70 |an array.to a sp| 00000520 65 63 69 66 69 63 20 76 61 6c 75 65 3a 0d 20 20 |ecific value:. | 00000530 20 20 20 20 31 30 20 44 49 4d 20 41 25 28 39 39 | 10 DIM A%(99| 00000540 39 29 0d 20 20 20 20 20 20 32 30 20 54 49 4d 45 |9). 20 TIME| 00000550 3d 30 0d 20 20 20 20 20 20 33 30 20 46 4f 52 20 |=0. 30 FOR | 00000560 49 25 3d 30 20 54 4f 20 39 39 39 3a 41 25 28 49 |I%=0 TO 999:A%(I| 00000570 25 29 3d 31 3a 4e 45 58 54 0d 20 20 20 20 20 20 |%)=1:NEXT. | 00000580 34 30 20 50 52 49 4e 54 20 54 49 4d 45 0d 0d 49 |40 PRINT TIME..I| 00000590 6e 20 4d 6f 64 65 20 36 2c 20 74 68 69 73 20 74 |n Mode 6, this t| 000005a0 6f 6f 6b 20 31 2e 33 38 20 73 65 63 6f 6e 64 73 |ook 1.38 seconds| 000005b0 20 6f 6e 20 6d 79 20 45 6c 65 63 74 72 6f 6e 2e | on my Electron.| 000005c0 20 4e 6f 77 20 72 65 70 6c 61 63 65 20 41 25 28 | Now replace A%(| 000005d0 39 39 39 29 20 62 79 0d 41 25 20 39 39 39 20 61 |999) by.A% 999 a| 000005e0 6e 64 20 41 25 3f 49 25 20 28 3f 20 69 73 20 70 |nd A%?I% (? is p| 000005f0 72 6f 6e 6f 75 6e 63 65 64 20 61 73 20 27 71 75 |ronounced as 'qu| 00000600 65 72 79 27 29 2e 20 57 69 74 68 20 74 68 69 73 |ery'). With this| 00000610 20 72 65 70 6c 61 63 65 6d 65 6e 74 2c 20 0d 74 | replacement, .t| 00000620 68 65 20 6c 6f 6f 70 20 74 61 6b 65 73 20 31 2e |he loop takes 1.| 00000630 30 32 20 73 65 63 6f 6e 64 73 3a 20 61 20 73 61 |02 seconds: a sa| 00000640 76 69 6e 67 20 6f 66 20 32 35 25 2e 20 54 68 69 |ving of 25%. Thi| 00000650 73 20 63 61 6e 20 62 65 20 61 20 76 65 72 79 20 |s can be a very | 00000660 6d 61 6a 6f 72 0d 73 61 76 69 6e 67 20 69 6e 20 |major.saving in | 00000670 61 20 67 61 6d 65 20 69 6e 20 77 68 69 63 68 20 |a game in which | 00000680 79 6f 75 20 6d 61 79 20 61 63 63 65 73 73 20 61 |you may access a| 00000690 20 6e 75 6d 62 65 72 20 6f 66 20 61 72 72 61 79 | number of array| 000006a0 73 20 68 75 6e 64 72 65 64 73 20 6f 66 0d 74 69 |s hundreds of.ti| 000006b0 6d 65 73 20 77 68 65 6e 65 76 65 72 20 74 68 65 |mes whenever the| 000006c0 20 6d 61 69 6e 20 6c 6f 6f 70 20 6f 66 20 74 68 | main loop of th| 000006d0 65 20 70 72 6f 67 72 61 6d 20 69 73 20 65 78 65 |e program is exe| 000006e0 63 75 74 65 64 2e 0d 20 20 20 44 49 4d 20 41 25 |cuted.. DIM A%| 000006f0 20 39 39 39 20 61 73 73 69 67 6e 73 20 31 30 30 | 999 assigns 100| 00000700 30 20 62 79 74 65 73 20 6f 66 20 6d 65 6d 6f 72 |0 bytes of memor| 00000710 79 20 66 72 6f 6d 20 41 25 20 74 6f 20 41 25 2b |y from A% to A%+| 00000720 39 39 39 2e 20 54 6f 20 66 69 6e 64 20 0d 6f 75 |999. To find .ou| 00000730 74 20 77 68 65 72 65 20 69 6e 20 6d 65 6d 6f 72 |t where in memor| 00000740 79 20 74 68 69 73 20 6d 69 67 68 74 20 62 65 2c |y this might be,| 00000750 20 74 79 70 65 20 50 52 49 4e 54 20 41 25 20 61 | type PRINT A% a| 00000760 66 74 65 72 20 74 68 65 20 61 62 6f 76 65 20 70 |fter the above p| 00000770 72 6f 67 72 61 6d 0d 68 61 73 20 62 65 65 6e 20 |rogram.has been | 00000780 72 75 6e 2e 20 41 25 3f 49 25 20 67 69 76 65 73 |run. A%?I% gives| 00000790 20 74 68 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 | the contents of| 000007a0 20 6d 65 6d 6f 72 79 20 6c 6f 63 61 74 69 6f 6e | memory location| 000007b0 20 41 25 2b 49 25 2c 20 62 75 74 0d 74 68 69 73 | A%+I%, but.this| 000007c0 20 63 6f 75 6c 64 20 61 6c 73 6f 20 62 65 20 61 | could also be a| 000007d0 63 63 65 73 73 65 64 20 77 69 74 68 20 3f 28 41 |ccessed with ?(A| 000007e0 25 2b 49 25 29 2e 20 54 68 69 73 20 67 69 76 65 |%+I%). This give| 000007f0 73 20 61 20 63 6c 75 65 20 74 6f 20 61 6e 20 65 |s a clue to an e| 00000800 76 65 6e 0d 67 72 65 61 74 65 72 20 73 61 76 69 |ven.greater savi| 00000810 6e 67 2e 20 52 65 70 6c 61 63 65 20 6c 69 6e 65 |ng. Replace line| 00000820 20 33 30 20 61 62 6f 76 65 20 77 69 74 68 3a 0d | 30 above with:.| 00000830 20 20 20 20 20 20 33 30 20 46 4f 52 20 49 25 3d | 30 FOR I%=| 00000840 41 25 20 54 4f 20 41 25 2b 39 39 39 3a 3f 49 25 |A% TO A%+999:?I%| 00000850 3d 31 3a 4e 45 58 54 0d 0d 54 68 69 73 20 61 63 |=1:NEXT..This ac| 00000860 63 6f 6d 70 6c 69 73 68 65 73 20 65 78 61 63 74 |complishes exact| 00000870 6c 79 20 74 68 65 20 73 61 6d 65 20 74 68 69 6e |ly the same thin| 00000880 67 2c 20 62 75 74 20 74 68 65 20 70 72 6f 67 72 |g, but the progr| 00000890 61 6d 20 6e 6f 77 20 72 75 6e 73 20 69 6e 20 0d |am now runs in .| 000008a0 30 2e 39 32 20 73 65 63 6f 6e 64 73 2c 20 61 20 |0.92 seconds, a | 000008b0 74 6f 74 61 6c 20 73 61 76 69 6e 67 20 6f 66 20 |total saving of | 000008c0 61 72 6f 75 6e 64 20 33 33 25 2e 0d 20 20 20 54 |around 33%.. T| 000008d0 68 69 73 20 69 73 20 61 6c 6c 20 76 65 72 79 20 |his is all very | 000008e0 77 65 6c 6c 2c 20 62 75 74 20 77 68 61 74 20 69 |well, but what i| 000008f0 66 20 79 6f 75 20 77 61 6e 74 20 74 6f 20 75 73 |f you want to us| 00000900 65 20 61 6e 20 61 72 72 61 79 20 77 68 69 63 68 |e an array which| 00000910 20 0d 74 61 6b 65 73 20 76 61 6c 75 65 73 20 72 | .takes values r| 00000920 65 71 75 69 72 69 6e 67 20 6d 6f 72 65 20 74 68 |equiring more th| 00000930 61 6e 20 6f 6e 65 20 62 79 74 65 20 6f 66 20 6d |an one byte of m| 00000940 65 6d 6f 72 79 20 28 69 2e 65 2e 20 69 6e 74 65 |emory (i.e. inte| 00000950 67 65 72 73 20 0d 67 72 65 61 74 65 72 20 74 68 |gers .greater th| 00000960 61 6e 20 32 35 35 29 3f 20 54 68 65 20 73 61 76 |an 255)? The sav| 00000970 69 6e 67 73 20 69 6e 20 74 69 6d 65 20 61 72 65 |ings in time are| 00000980 20 6e 6f 20 6c 65 73 73 20 64 72 61 6d 61 74 69 | no less dramati| 00000990 63 20 75 73 69 6e 67 20 74 68 65 20 21 0d 28 70 |c using the !.(p| 000009a0 72 6f 6e 6f 75 6e 63 65 64 20 27 70 6c 69 6e 67 |ronounced 'pling| 000009b0 27 29 20 69 6e 64 69 72 65 63 74 69 6f 6e 20 6f |') indirection o| 000009c0 70 65 72 61 74 6f 72 2e 20 54 68 65 20 45 6c 65 |perator. The Ele| 000009d0 63 74 72 6f 6e 20 73 74 6f 72 65 73 20 69 6e 74 |ctron stores int| 000009e0 65 67 65 72 73 0d 69 6e 20 66 6f 75 72 20 63 6f |egers.in four co| 000009f0 6e 73 65 63 75 74 69 76 65 20 62 79 74 65 73 2c |nsecutive bytes,| 00000a00 20 61 6e 64 20 21 49 25 20 67 69 76 65 73 20 74 | and !I% gives t| 00000a10 68 65 20 69 6e 74 65 67 65 72 20 73 74 6f 72 65 |he integer store| 00000a20 64 20 69 6e 20 6c 6f 63 61 74 69 6f 6e 73 0d 49 |d in locations.I| 00000a30 25 2c 20 49 25 2b 31 2c 20 49 25 2b 32 20 61 6e |%, I%+1, I%+2 an| 00000a40 64 20 49 25 2b 33 2e 20 46 6f 72 20 61 6e 20 69 |d I%+3. For an i| 00000a50 6e 74 65 67 65 72 20 61 72 72 61 79 20 77 69 74 |nteger array wit| 00000a60 68 20 31 30 30 30 20 6d 65 6d 62 65 72 73 2c 20 |h 1000 members, | 00000a70 34 30 30 30 20 0d 28 31 30 30 30 2a 34 29 20 6d |4000 .(1000*4) m| 00000a80 65 6d 6f 72 79 20 6c 6f 63 61 74 69 6f 6e 73 20 |emory locations | 00000a90 6d 75 73 74 20 62 65 20 72 65 73 65 72 76 65 64 |must be reserved| 00000aa0 2c 20 61 6e 64 20 74 68 65 20 73 74 65 70 20 73 |, and the step s| 00000ab0 69 7a 65 20 73 68 6f 75 6c 64 20 62 65 0d 34 2e |ize should be.4.| 00000ac0 20 52 65 70 6c 61 63 65 20 6c 69 6e 65 73 20 31 | Replace lines 1| 00000ad0 30 20 61 6e 64 20 33 30 20 77 69 74 68 3a 0d 20 |0 and 30 with:. | 00000ae0 20 20 20 20 20 31 30 20 44 49 4d 20 41 25 20 33 | 10 DIM A% 3| 00000af0 39 39 39 0d 20 20 20 20 20 20 33 30 20 46 4f 52 |999. 30 FOR| 00000b00 20 49 25 3d 41 25 20 54 4f 20 41 25 2b 33 39 39 | I%=A% TO A%+399| 00000b10 39 20 53 54 45 50 34 3a 21 49 25 3d 31 3a 4e 45 |9 STEP4:!I%=1:NE| 00000b20 58 54 0d 0d 54 68 69 73 20 69 73 20 62 61 72 65 |XT..This is bare| 00000b30 6c 79 20 73 6c 6f 77 65 72 2c 20 74 61 6b 69 6e |ly slower, takin| 00000b40 67 20 30 2e 39 34 20 73 65 63 6f 6e 64 73 2e 20 |g 0.94 seconds. | 00000b50 49 6e 20 61 64 64 69 74 69 6f 6e 2c 20 61 6e 79 |In addition, any| 00000b60 20 69 6e 74 65 67 65 72 0d 76 61 6c 75 65 20 63 | integer.value c| 00000b70 61 6e 20 62 65 20 70 6c 61 63 65 64 20 69 6e 20 |an be placed in | 00000b80 74 68 65 20 6c 6f 63 61 74 69 6f 6e 20 49 25 20 |the location I% | 00000b90 62 79 20 75 73 69 6e 67 20 21 49 25 3d 3c 76 61 |by using !I%=<va| 00000ba0 6c 75 65 3e 2e 0d 20 20 20 53 74 72 69 6e 67 20 |lue>.. String | 00000bb0 61 72 72 61 79 73 20 63 61 6e 20 62 65 20 72 65 |arrays can be re| 00000bc0 70 6c 61 63 65 64 20 75 73 69 6e 67 20 74 68 65 |placed using the| 00000bd0 20 24 20 28 70 72 6f 6e 6f 75 6e 63 65 64 20 27 | $ (pronounced '| 00000be0 73 74 72 69 6e 67 27 29 20 0d 69 6e 64 69 72 65 |string') .indire| 00000bf0 63 74 69 6f 6e 20 6f 70 65 72 61 74 6f 72 2c 20 |ction operator, | 00000c00 61 6e 64 20 74 68 65 20 73 61 76 69 6e 67 73 20 |and the savings | 00000c10 61 72 65 20 65 76 65 6e 20 67 72 65 61 74 65 72 |are even greater| 00000c20 2e 20 54 72 79 20 75 73 69 6e 67 0d 20 20 20 20 |. Try using. | 00000c30 20 20 31 30 20 44 49 4d 20 41 24 28 39 39 39 29 | 10 DIM A$(999)| 00000c40 0d 20 20 20 20 20 20 33 30 20 46 4f 52 20 49 25 |. 30 FOR I%| 00000c50 3d 30 20 54 4f 20 39 39 39 3a 41 24 28 49 25 29 |=0 TO 999:A$(I%)| 00000c60 3d 22 54 45 53 54 22 3a 4e 45 58 54 0d 0d 54 68 |="TEST":NEXT..Th| 00000c70 69 73 20 74 6f 6f 6b 20 31 2e 34 38 20 73 65 63 |is took 1.48 sec| 00000c80 6f 6e 64 73 20 6f 6e 20 6d 79 20 45 6c 65 63 74 |onds on my Elect| 00000c90 72 6f 6e 2e 20 57 68 65 6e 20 75 73 69 6e 67 20 |ron. When using | 00000ca0 69 6e 64 69 72 65 63 74 69 6f 6e 20 6f 70 65 72 |indirection oper| 00000cb0 61 74 6f 72 73 0d 74 68 65 20 73 74 72 69 6e 67 |ators.the string| 00000cc0 20 22 54 45 53 54 22 20 72 65 71 75 69 72 65 73 | "TEST" requires| 00000cd0 20 66 69 76 65 20 6d 65 6d 6f 72 79 20 6c 6f 63 | five memory loc| 00000ce0 61 74 69 6f 6e 73 2c 20 6f 6e 65 20 66 6f 72 20 |ations, one for | 00000cf0 65 61 63 68 20 6c 65 74 74 65 72 2c 0d 61 6e 64 |each letter,.and| 00000d00 20 6f 6e 65 20 66 6f 72 20 61 20 3c 52 45 54 55 | one for a <RETU| 00000d10 52 4e 3e 20 74 6f 20 69 6e 64 69 63 61 74 65 20 |RN> to indicate | 00000d20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 73 |the end of the s| 00000d30 74 72 69 6e 67 2e 20 54 6f 20 73 65 65 20 68 6f |tring. To see ho| 00000d40 77 20 74 68 65 0d 24 20 69 6e 64 69 72 65 63 74 |w the.$ indirect| 00000d50 69 6f 6e 20 6f 70 65 72 61 74 6f 72 20 77 6f 72 |ion operator wor| 00000d60 6b 73 2c 20 74 72 79 20 61 6c 74 65 72 69 6e 67 |ks, try altering| 00000d70 20 6c 69 6e 65 73 20 31 30 20 61 6e 64 20 33 30 | lines 10 and 30| 00000d80 20 74 6f 3a 0d 20 20 20 20 20 20 31 30 20 44 49 | to:. 10 DI| 00000d90 4d 20 41 25 20 39 39 39 39 0d 20 20 20 20 20 20 |M A% 9999. | 00000da0 33 30 20 46 4f 52 20 49 25 3d 41 25 20 54 4f 20 |30 FOR I%=A% TO | 00000db0 41 25 2b 34 39 39 39 20 53 54 45 50 20 35 3a 24 |A%+4999 STEP 5:$| 00000dc0 49 25 3d 22 54 45 53 54 22 3a 4e 45 58 54 0d 0d |I%="TEST":NEXT..| 00000dd0 54 68 69 73 20 73 61 76 65 73 20 6f 76 65 72 20 |This saves over | 00000de0 68 61 6c 66 20 61 20 73 65 63 6f 6e 64 2c 20 74 |half a second, t| 00000df0 61 6b 69 6e 67 20 30 2e 39 36 20 73 65 63 6f 6e |aking 0.96 secon| 00000e00 64 73 2e 20 56 69 72 74 75 61 6c 6c 79 20 6e 6f |ds. Virtually no| 00000e10 20 74 69 6d 65 20 69 73 0d 6c 6f 73 74 20 62 79 | time is.lost by| 00000e20 20 73 65 74 74 69 6e 67 20 61 73 69 64 65 20 6d | setting aside m| 00000e30 6f 72 65 20 6d 65 6d 6f 72 79 2c 20 61 6e 64 20 |ore memory, and | 00000e40 75 73 69 6e 67 20 61 20 6c 61 72 67 65 72 20 73 |using a larger s| 00000e50 74 65 70 20 73 69 7a 65 2c 20 66 6f 72 20 0d 65 |tep size, for .e| 00000e60 78 61 6d 70 6c 65 20 44 49 4d 20 41 25 20 39 39 |xample DIM A% 99| 00000e70 39 39 20 61 6e 64 20 53 54 45 50 20 31 30 2e 20 |99 and STEP 10. | 00000e80 54 68 65 20 6d 61 78 69 6d 75 6d 20 6c 65 6e 67 |The maximum leng| 00000e90 74 68 20 6f 66 20 61 20 73 74 72 69 6e 67 20 77 |th of a string w| 00000ea0 68 69 63 68 20 0d 63 61 6e 20 62 65 20 73 74 6f |hich .can be sto| 00000eb0 72 65 64 20 6c 69 6b 65 20 74 68 69 73 20 69 73 |red like this is| 00000ec0 20 6f 6e 65 20 6c 65 73 73 20 74 68 61 6e 20 74 | one less than t| 00000ed0 68 65 20 73 74 65 70 20 73 69 7a 65 20 75 73 65 |he step size use| 00000ee0 64 2e 20 44 75 65 20 74 6f 20 74 68 65 0d 77 61 |d. Due to the.wa| 00000ef0 79 20 69 6e 20 77 68 69 63 68 20 73 74 72 69 6e |y in which strin| 00000f00 67 20 61 72 72 61 79 73 20 61 72 65 20 61 6c 6c |g arrays are all| 00000f10 6f 63 61 74 65 64 20 6d 65 6d 6f 72 79 20 6f 6e |ocated memory on| 00000f20 20 74 68 65 20 45 6c 65 63 74 72 6f 6e 2c 20 74 | the Electron, t| 00000f30 68 65 0d 73 61 76 69 6e 67 73 20 69 6e 20 6d 65 |he.savings in me| 00000f40 6d 6f 72 79 20 61 72 65 20 71 75 69 74 65 20 73 |mory are quite s| 00000f50 69 67 6e 69 66 69 63 61 6e 74 2e 0d 20 20 20 49 |ignificant.. I| 00000f60 6e 63 69 64 65 6e 74 61 6c 6c 79 2c 20 77 68 65 |ncidentally, whe| 00000f70 6e 20 69 6e 64 69 72 65 63 74 69 6f 6e 20 6f 70 |n indirection op| 00000f80 65 72 61 74 6f 72 73 20 61 72 65 20 75 73 65 64 |erators are used| 00000f90 20 6c 69 6b 65 20 74 68 69 73 20 73 6f 6d 65 20 | like this some | 00000fa0 6f 66 0d 74 68 65 20 42 61 73 69 63 20 73 74 72 |of.the Basic str| 00000fb0 69 6e 67 20 6f 70 65 72 61 74 6f 72 73 20 63 61 |ing operators ca| 00000fc0 6e 20 62 65 20 73 69 6d 75 6c 61 74 65 64 20 76 |n be simulated v| 00000fd0 65 72 79 20 65 61 73 69 6c 79 2e 20 49 6e 20 74 |ery easily. In t| 00000fe0 68 65 20 61 62 6f 76 65 0d 65 78 61 6d 70 6c 65 |he above.example| 00000ff0 73 2c 20 50 52 49 4e 54 20 3f 41 25 20 67 69 76 |s, PRINT ?A% giv| 00001000 65 73 20 74 68 65 20 41 53 43 49 49 20 63 6f 64 |es the ASCII cod| 00001010 65 20 66 6f 72 20 54 2c 20 77 68 69 63 68 20 50 |e for T, which P| 00001020 52 49 4e 54 20 24 28 41 25 2b 31 29 20 0d 67 69 |RINT $(A%+1) .gi| 00001030 76 65 73 20 45 53 54 2c 20 73 69 6d 75 6c 61 74 |ves EST, simulat| 00001040 69 6e 67 20 74 68 65 20 6f 70 65 72 61 74 69 6f |ing the operatio| 00001050 6e 20 6f 66 20 74 68 65 20 52 49 47 48 54 24 20 |n of the RIGHT$ | 00001060 66 75 6e 63 74 69 6f 6e 2e 20 54 68 65 20 45 6c |function. The El| 00001070 65 63 74 72 6f 6e 0d 73 69 6d 70 6c 79 20 72 65 |ectron.simply re| 00001080 61 64 73 20 74 68 65 20 73 74 72 69 6e 67 20 66 |ads the string f| 00001090 72 6f 6d 20 77 68 65 72 65 76 65 72 20 69 74 20 |rom wherever it | 000010a0 69 73 20 74 6f 6c 64 20 74 6f 20 73 74 61 72 74 |is told to start| 000010b0 2c 20 61 6e 64 20 73 74 6f 70 73 20 0d 77 68 65 |, and stops .whe| 000010c0 6e 20 69 74 20 72 65 61 63 68 65 73 20 61 20 3c |n it reaches a <| 000010d0 52 45 54 55 52 4e 3e 20 28 41 53 43 49 49 20 76 |RETURN> (ASCII v| 000010e0 61 6c 75 65 20 31 33 29 2e 20 4c 45 46 54 24 20 |alue 13). LEFT$ | 000010f0 63 61 6e 20 61 6c 73 6f 20 62 65 20 73 69 6d 75 |can also be simu| 00001100 6c 61 74 65 64 0d 62 79 20 70 6c 61 63 69 6e 67 |lated.by placing| 00001110 20 61 20 3c 52 45 54 55 52 4e 3e 20 69 6e 20 61 | a <RETURN> in a| 00001120 20 70 61 72 74 69 63 75 6c 61 72 20 6d 65 6d 6f | particular memo| 00001130 72 79 20 6c 6f 63 61 74 69 6f 6e 2e 20 46 6f 72 |ry location. For| 00001140 20 65 78 61 6d 70 6c 65 20 0d 24 28 41 25 2b 32 | example .$(A%+2| 00001150 29 3d 22 22 20 77 68 69 63 68 20 70 75 74 73 20 |)="" which puts | 00001160 61 20 3c 52 45 54 55 52 4e 3e 20 63 68 61 72 61 |a <RETURN> chara| 00001170 63 74 65 72 20 61 74 20 41 25 2b 32 2c 20 66 6f |cter at A%+2, fo| 00001180 6c 6c 6f 77 65 64 20 62 79 20 50 52 49 4e 54 20 |llowed by PRINT | 00001190 0d 24 41 25 20 77 69 6c 6c 20 67 69 76 65 20 54 |.$A% will give T| 000011a0 45 2e 20 53 74 72 69 6e 67 73 20 63 61 6e 20 62 |E. Strings can b| 000011b0 65 20 63 6f 6d 62 69 6e 65 64 20 62 79 20 70 6c |e combined by pl| 000011c0 61 63 69 6e 67 20 74 68 65 20 66 69 72 73 74 20 |acing the first | 000011d0 6c 65 74 74 65 72 20 6f 66 0d 6f 6e 65 20 73 74 |letter of.one st| 000011e0 72 69 6e 67 20 69 6e 20 74 68 65 20 6c 6f 63 61 |ring in the loca| 000011f0 74 69 6f 6e 20 6f 63 63 75 70 69 65 64 20 62 79 |tion occupied by| 00001200 20 74 68 65 20 3c 52 45 54 55 52 4e 3e 20 66 6f | the <RETURN> fo| 00001210 72 20 61 6e 6f 74 68 65 72 20 73 74 72 69 6e 67 |r another string| 00001220 2e 0d 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 74 |..For example, t| 00001230 79 70 65 20 53 28 41 25 2b 32 29 3d 22 53 54 49 |ype S(A%+2)="STI| 00001240 4e 47 22 2e 20 50 52 49 4e 54 20 24 41 25 20 6e |NG". PRINT $A% n| 00001250 6f 77 20 67 69 76 65 73 20 54 45 53 54 49 4e 47 |ow gives TESTING| 00001260 2e 0d 20 20 20 46 69 6e 61 6c 6c 79 2c 20 69 74 |.. Finally, it| 00001270 20 69 73 20 77 6f 72 74 68 20 65 78 61 6d 69 6e | is worth examin| 00001280 69 6e 67 20 74 68 65 20 73 61 76 69 6e 67 73 20 |ing the savings | 00001290 77 68 69 63 68 20 63 61 6e 20 62 65 20 6d 61 64 |which can be mad| 000012a0 65 20 6f 6e 20 75 73 69 6e 67 0d 74 77 6f 20 28 |e on using.two (| 000012b0 6f 72 20 6d 6f 72 65 29 20 64 69 6d 65 6e 73 69 |or more) dimensi| 000012c0 6f 6e 61 6c 20 61 72 72 61 79 73 2e 20 54 68 65 |onal arrays. The| 000012d0 73 65 20 61 72 65 20 65 76 65 6e 20 73 6c 6f 77 |se are even slow| 000012e0 65 72 20 74 68 61 6e 20 6f 6e 65 20 0d 64 69 6d |er than one .dim| 000012f0 65 6e 73 69 6f 6e 61 6c 20 61 72 72 61 79 73 2e |ensional arrays.| 00001300 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 74 79 | For example, ty| 00001310 70 65 20 69 6e 20 74 68 65 20 6c 69 6e 65 73 20 |pe in the lines | 00001320 6c 69 73 74 65 64 20 68 65 72 65 3a 0d 20 20 20 |listed here:. | 00001330 20 20 20 31 30 20 44 49 4d 20 41 25 28 39 2c 39 | 10 DIM A%(9,9| 00001340 39 29 0d 20 20 20 20 20 20 33 30 20 46 4f 52 20 |9). 30 FOR | 00001350 4b 25 3d 30 20 54 4f 20 39 3a 46 4f 52 20 4a 25 |K%=0 TO 9:FOR J%| 00001360 3d 30 20 54 4f 20 39 39 3a 41 25 28 4b 25 2c 4a |=0 TO 99:A%(K%,J| 00001370 25 29 3d 31 3a 4e 45 58 54 0d 0d 57 68 65 6e 20 |%)=1:NEXT..When | 00001380 72 75 6e 2c 20 74 68 65 20 70 72 6f 67 72 61 6d |run, the program| 00001390 20 6e 6f 77 20 74 61 6b 65 73 20 32 2e 32 37 20 | now takes 2.27 | 000013a0 73 65 63 6f 6e 64 73 2e 20 49 6e 64 69 72 65 63 |seconds. Indirec| 000013b0 74 69 6f 6e 20 6f 70 65 72 61 74 6f 72 73 20 64 |tion operators d| 000013c0 6f 20 0d 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 65 |o .not allow the| 000013d0 20 75 73 65 20 6f 66 20 6d 6f 72 65 20 74 68 61 | use of more tha| 000013e0 6e 20 6f 6e 65 20 64 69 6d 65 6e 73 69 6f 6e 2c |n one dimension,| 000013f0 20 73 6f 20 74 68 65 20 74 77 6f 20 64 69 6d 65 | so the two dime| 00001400 6e 73 69 6f 6e 61 6c 0d 61 72 72 61 79 20 61 62 |nsional.array ab| 00001410 6f 76 65 20 6d 75 73 74 20 62 65 20 72 65 70 6c |ove must be repl| 00001420 61 63 65 64 20 62 79 20 74 68 65 20 6f 6e 65 20 |aced by the one | 00001430 64 69 6d 65 6e 73 69 6f 6e 61 6c 20 73 65 74 20 |dimensional set | 00001440 6f 66 20 6d 65 6d 6f 72 79 20 0d 6c 6f 63 61 74 |of memory .locat| 00001450 69 6f 6e 73 20 44 49 4d 20 41 25 20 39 39 39 2e |ions DIM A% 999.| 00001460 20 54 68 65 6e 20 4b 25 20 61 6e 64 20 4a 25 20 | Then K% and J% | 00001470 68 61 76 65 20 74 6f 20 62 65 20 72 65 70 6c 61 |have to be repla| 00001480 63 65 64 20 62 79 20 49 25 20 72 75 6e 6e 69 6e |ced by I% runnin| 00001490 67 0d 66 72 6f 6d 20 41 25 20 74 6f 20 41 25 2b |g.from A% to A%+| 000014a0 39 39 39 2e 20 54 68 69 73 20 62 72 69 6e 67 73 |999. This brings| 000014b0 20 74 68 65 20 74 69 6d 65 20 64 6f 77 6e 20 74 | the time down t| 000014c0 6f 20 30 2e 39 32 20 73 65 63 6f 6e 64 73 2c 20 |o 0.92 seconds, | 000014d0 62 75 74 20 79 6f 75 20 64 6f 0d 68 61 76 65 20 |but you do.have | 000014e0 74 6f 20 62 65 20 63 61 72 65 66 75 6c 20 77 69 |to be careful wi| 000014f0 74 68 20 74 68 65 20 61 72 69 74 68 6d 65 74 69 |th the arithmeti| 00001500 63 2e 20 49 6e 20 74 68 69 73 20 65 78 61 6d 70 |c. In this examp| 00001510 6c 65 2c 20 74 68 65 20 61 63 74 75 61 6c 0d 6c |le, the actual.l| 00001520 6f 63 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 65 |ocation of the e| 00001530 6c 65 6d 65 6e 74 20 41 25 28 4b 25 2c 6a 25 29 |lement A%(K%,j%)| 00001540 20 69 73 20 66 6f 75 6e 64 20 61 73 20 66 6f 6c | is found as fol| 00001550 6c 6f 77 73 3a 0d 20 20 20 20 20 20 49 25 3d 41 |lows:. I%=A| 00001560 25 2b 31 30 30 2a 4b 25 2b 4a 25 0d 0d 53 6f 20 |%+100*K%+J%..So | 00001570 79 6f 75 20 6d 75 73 74 20 72 65 6d 65 6d 62 65 |you must remembe| 00001580 72 20 74 68 61 74 20 69 6e 63 72 65 61 73 69 6e |r that increasin| 00001590 67 20 49 25 20 62 79 20 6f 6e 65 20 63 6f 72 72 |g I% by one corr| 000015a0 65 73 70 6f 6e 64 73 20 74 6f 20 69 6e 63 72 65 |esponds to incre| 000015b0 61 73 69 6e 67 0d 4a 25 20 62 79 20 6f 6e 65 2c |asing.J% by one,| 000015c0 20 75 6e 6c 65 73 73 20 74 68 65 20 76 61 6c 75 | unless the valu| 000015d0 65 20 6f 66 20 4a 25 20 69 73 20 39 39 2c 20 77 |e of J% is 99, w| 000015e0 68 65 6e 20 69 74 20 63 6f 72 72 65 73 70 6f 6e |hen it correspon| 000015f0 64 73 20 74 6f 20 69 6e 63 72 65 61 73 2d 0d 69 |ds to increas-.i| 00001600 6e 67 20 4b 25 20 62 79 20 31 20 61 6e 64 20 72 |ng K% by 1 and r| 00001610 65 73 65 74 74 69 6e 67 20 4a 25 20 74 6f 20 30 |esetting J% to 0| 00001620 2e 20 49 6e 63 72 65 61 73 69 6e 67 20 49 25 20 |. Increasing I% | 00001630 62 79 20 31 30 30 20 63 6f 72 72 65 73 70 6f 6e |by 100 correspon| 00001640 64 73 20 74 6f 0d 69 6e 63 72 65 61 73 69 6e 67 |ds to.increasing| 00001650 20 4b 25 20 62 79 20 31 20 61 6e 64 20 6c 65 61 | K% by 1 and lea| 00001660 76 69 6e 67 20 4a 25 20 61 6c 6f 6e 65 2e 20 54 |ving J% alone. T| 00001670 68 65 20 73 69 74 75 61 74 69 6f 6e 20 69 73 20 |he situation is | 00001680 65 73 73 65 6e 74 69 61 6c 6c 79 0d 73 69 6d 69 |essentially.simi| 00001690 6c 61 72 20 69 6e 20 74 68 65 20 63 61 73 65 20 |lar in the case | 000016a0 6f 66 20 74 68 65 20 21 20 61 6e 64 20 24 20 69 |of the ! and $ i| 000016b0 6e 64 69 72 65 63 74 69 6f 6e 20 6f 70 65 72 61 |ndirection opera| 000016c0 74 6f 72 73 2c 20 62 75 74 20 74 68 65 6e 20 79 |tors, but then y| 000016d0 6f 75 0d 61 6c 73 6f 20 68 61 76 65 20 74 6f 20 |ou.also have to | 000016e0 62 65 20 63 61 72 65 66 75 6c 20 61 62 6f 75 74 |be careful about| 000016f0 20 74 68 65 20 73 69 7a 65 73 2e 20 42 79 20 74 | the sizes. By t| 00001700 68 65 20 77 61 79 2c 20 64 6f 6e 27 74 20 73 75 |he way, don't su| 00001710 63 63 75 6d 62 20 74 6f 0d 74 68 65 20 74 65 6d |ccumb to.the tem| 00001720 70 74 61 74 69 6f 6e 20 6f 66 20 6c 65 74 74 69 |ptation of letti| 00001730 6e 67 20 74 68 65 20 6d 69 63 72 6f 20 64 6f 20 |ng the micro do | 00001740 74 68 65 20 61 72 69 74 68 6d 65 74 69 63 20 66 |the arithmetic f| 00001750 6f 72 20 79 6f 75 20 62 79 20 75 73 69 6e 67 20 |or you by using | 00001760 0d 61 6e 20 65 71 75 61 74 69 6f 6e 20 73 75 63 |.an equation suc| 00001770 68 20 61 73 20 74 68 65 20 6f 6e 65 20 61 62 6f |h as the one abo| 00001780 76 65 20 69 6e 73 69 64 65 20 74 68 65 20 46 4f |ve inside the FO| 00001790 52 2d 4e 45 58 54 20 6c 6f 6f 70 20 2d 20 79 6f |R-NEXT loop - yo| 000017a0 75 20 77 69 6c 6c 0d 76 65 72 79 20 6c 69 6b 65 |u will.very like| 000017b0 6c 79 20 6c 6f 73 65 20 61 6c 6c 20 74 68 65 20 |ly lose all the | 000017c0 74 69 6d 65 20 73 61 76 65 64 21 0d 20 20 20 20 |time saved!. | 000017d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00001800 20 43 2e 20 46 72 61 6e 63 69 73 2c 20 45 55 47 | C. Francis, EUG| 00001810 20 23 35 33 0d 20 20 20 20 20 20 20 20 20 20 20 | #53. | 00001820 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001830 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 53 | 'S| 00001840 74 6f 6c 65 6e 27 20 66 72 6f 6d 20 45 4c 42 55 |tolen' from ELBU| 00001850 47 20 56 6f 6c 20 31 20 4e 6f 20 31 30 0d |G Vol 1 No 10.| 0000185e