Why does this give a "subscript out of range"? It was working but I must have changed something and I do not see it. I have marked where the prog goes wrong with “” Your help will be appreciated.
DIM M$(9)
SHELL "if exist go.bat del go.bat"
PRINT : PRINT : PRINT
PRINT "This program requires 5 files"
PRINT
PRINT " file description"
PRINT " HEADER start of script action"
PRINT " FILLER script action per drawing !!! = drawing"
PRINT " FOOTER last action of script"
PRINT " LISTING list with all drawings to do without extension"
PRINT " BAT One line containing action for all files"
PRINT
OPEN "header" FOR INPUT AS #2
OPEN "new.scr" FOR OUTPUT AS #3
WHILE NOT EOF(2)
LINE INPUT #2, h$
PRINT #3, h$
WEND
CLOSE 2
CLOSE 3
OPEN "listing" FOR INPUT AS #1
 WHILE NOT EOF(1)
FOR x = 1 TO 9
M$(x) = ""
NEXT
LINE INPUT #1, File$
Tel = 1
WHILE INSTR(File$, "|" > 0
M$(Tel) = MID$(File$, 1, INSTR(File$, "|" - 1)
Tel = Tel + 1
File$ = MID$(File$, INSTR(File$, "|" + 1)
WEND
M$(Tel) = File$
 ' All vars are in use now where Tel is the max
OPEN "bat" FOR INPUT AS #2
OPEN "go.bat" FOR APPEND AS #3
LINE INPUT #2, h$
WHILE INSTR(h$, "!!!" > 0
Etc
DIM M$(9)
SHELL "if exist go.bat del go.bat"
PRINT : PRINT : PRINT
PRINT "This program requires 5 files"
PRINT " file description"
PRINT " HEADER start of script action"
PRINT " FILLER script action per drawing !!! = drawing"
PRINT " FOOTER last action of script"
PRINT " LISTING list with all drawings to do without extension"
PRINT " BAT One line containing action for all files"
OPEN "header" FOR INPUT AS #2
OPEN "new.scr" FOR OUTPUT AS #3
WHILE NOT EOF(2)
LINE INPUT #2, h$
PRINT #3, h$
WEND
CLOSE 2
CLOSE 3
OPEN "listing" FOR INPUT AS #1
 WHILE NOT EOF(1)
FOR x = 1 TO 9
M$(x) = ""
NEXT
LINE INPUT #1, File$
Tel = 1
WHILE INSTR(File$, "|" > 0
M$(Tel) = MID$(File$, 1, INSTR(File$, "|" - 1)
Tel = Tel + 1
File$ = MID$(File$, INSTR(File$, "|" + 1)
WEND
M$(Tel) = File$
 ' All vars are in use now where Tel is the max
OPEN "bat" FOR INPUT AS #2
OPEN "go.bat" FOR APPEND AS #3
LINE INPUT #2, h$
WHILE INSTR(h$, "!!!" > 0
Etc