First slot: 19.234 2nd slot: -12.6 3rd slot: 99.85
The slots of the array can be filled in any order, and can be used in any order. Here is part of the above program:
DIM VALUE(1 TO 5) ' Ask for an array of floating point numbers ' LET VALUE(2) = -12.6 ' Put -12.6 into the second slot LET VALUE(3) = 99.85 ' Put 99.85 into the third slot LET VALUE(1) = 19.234 ' Put 19.234 into the first slot of the array . . .
The array looks the same as it did before. Slots are automatically filled with zero when the array starts out, so any slot not explicitly changed keeps holding a zero.
19.234 |
-12.6 |
99.85 |
0.0 |
0.0 |
1 |
2 |
3 |
4 |
5 |
What does the following statement do:
LET VALUE(4) = VALUE(1)
Hint: think about the steps of an assignment statement.