System/34 BASIC - Array

Array

Some versions of BASIC allow the programmer to sort an array. S/34 BASIC doesn't provide a function for this, but it does provide an interesting remedy. The programmer can define an array with the same number of elements as the target array and use AIDX or DIDX to create an ascending or descending index. Each element of the new array will contain a number representing the ordinal sorted position of the target array, so if AMERICA is the sixth element of array A$ but first in alphabetical order, then setting A = AIDX(A$) would cause A(1) to contain the value 6.

Writing a BASIC program is much more fun than rewriting the same program each time you use it, therefore the authors of BASIC allow programmers to SAVE their program code to a library member and to REPLACE it when changes are made.

SAVE PROG1,PGMRLIB causes the current module to be saved as a subroutine member (type R) named PROG1 in a user library named PGMRLIB.

Note that System/34 files are not part of libraries. If a disk file is named FNF001, then an OPEN statement like this one can work:

OPEN #3:"NAME=FNF001,SEQUENTIAL",INPUT

It doesn't matter which library is used to access file FNF001.

RENUMBER is the S/34 BASIC command used to renumber statements. All internal references to statement numbers are immediately recalculated.

System/34 BASIC has a very dangerous command called FREE. Typing FREE followed by a filename deletes that file without a trace. It will work for every user file, unless there is a conflict of security or an in-use condition that blocks it.

System/34 BASIC has another dangerous command called LOCK. The LOCK command will make the current program source code inaccessible and it is not reversible. Always save an unlocked copy before using LOCK.

Read more about this topic:  System/34 BASIC

Famous quotes containing the word array:

    Any one who knows what the worth of family affection is among the lower classes, and who has seen the array of little portraits stuck over a labourer’s fireplace ... will perhaps feel with me that in counteracting the tendencies, social and industrial, which every day are sapping the healthier family affections, the sixpenny photograph is doing more for the poor than all the philanthropists in the world.
    Macmillan’s Magazine (London, September 1871)