Msg: 73 *Conference*
06-12-91 14:57:34
From: JAMES WILSON
To : ALL
Subj: BAD SUBSCRIPT ERROR
The program bellow was supposed to read a large file and output it to the com. port in two collum format with 60 lines to a page. The problem comes in the initial run at A$; I get a 'BAD SUBSCRIPT' error when the program tries to read beyond A$(10). Even though the DIM A$(60) statement is supposed to handle this. Where did I go wrong; I remember having done this before with no error. 5 'program to fold a listing for two collum x 60 lines / page 10 CLEAR2000:DIMA$(60) 20 OPEN"REC.DO"FORINPUT AS1 21 OPEN "COM:68N1E"FOR OUTPUT AS 2 30 FOR N=1 TO 60 35 IF EOF(1) THEN A$(N)=" ":GOTO50 40 LINEINPUT#1,A$(N) 41 IF LEN(A$(N))>39 THEN A$(N)=LEFT$(A$(N),39) 50 NEXT 70 FOR N=1 TO 60 75 IF EOF(1) THEN B$=" ":GOTO90 80 LINEINPUT#1,B$ 81 IF LEN(B$)>39 THEN B$=LEFT$(B$,39) 90 C$=A$(N)+SPACE$(40-LEN(A$(N)))+B$ 95 PRINT#2,C$ 99 NEXT 100 IF EOF(1) THEN CLOSE:MENU 101 GOTO30