10 PRINT BASIC Random File Conversion Program 7.0:PRINT
20 INPUT Enter name of old random file; OLDFILE$
30 INPUT Enter name of new random file; NEWFILE$
40 INPUT Enter record size; RECSIZE
50 INPUT Enter number of records; COUNT
60 MAXRUN = 10
70 IF RECSIZE > MAXRUN * 255 THEN
       PRINT Record size too big.  Maximum value is ;MAXRUN * 255:
       GOTO 240
80 OPEN i, 1, OLDFILE$
90 OPEN b, 2, NEWFILE$, RECSIZE
100 OPTION BASE 1
110 DIM R$(MAXRUN), S(MAXRUN)
120 FOR I=1 TO MAXRUN
130    IF RECSIZE > 255 THEN
           S[I] = 255: RECSIZE = RECSIZE255
       ELSE
           S[I] = RECSIZE: RECSIZE = 0
140 NEXT I
150 FIELD 2,
    S[1] AS R$[1],
    S[2] AS R$[2],
    S[3] AS R$[3],
    S[4] AS R$[4],
    S[5] AS R$[5],
    S[6] AS R$[6],
    S[7] AS R$[7],
    S[8] AS R$[8],
    S[9] AS R$[9],
    S[10] AS R$[10]
160 FOR J = 1 TO COUNT
170    FOR  I = 1 TO MAXRUN
180       IF S[I] > 0 THEN LSET R$[I]=INPUT$(S[I],1)
190    NEXT I
200    PUT 2
210 NEXT J
220 PRINT
230 PRINT COUNT;  records written
240 CLOSE
250 END
