[Edit] Oops - Ian posted while I was typing mine and beat me to it!
Like IanM says, your problem is lack of indentation. I pasted your code into my IDE and used the auto-indentation feature (sorry - shameless plug I know)!
Take a look:
a#=1
c#=1
T=0
T1=0
S=0
R=0
MoraleS1=1
MoraleS2=1
T$="n"
Main#=0
Mode#=0
ShipDataS=1
Terrain$=""
CName$="None."
StatView$="n"
NoRecord$="n"
edit$="n"
rem Command, Strength, Technique, Intelligence, Innovation, Eloquence
DIM charstats(11,6)
rem None set
DIM duelskills(1,1)
rem None set
DIM landskills(1,1)
rem None set
DIM shipskills(3,8)
rem Ship Action vs Action modifiers
rem (1)Assault, (2)Barrage, (3)Board, (4)Burning Volley, (5)Burning Barrage, (6)Close In
rem (7)Evasion, (8)Extreme Evasion, (9)Flaming Siege Shot, (10)Flee, (11)Heavy Barrage
rem (12)Heavy Fire Barrage, (13)Intercept, (14)Ram, (15)Siege Shot, (16)Strategic Ram
rem (17)Strategic Withdrawl, (18)Volley
DIM shipactions#(18,18)
rem Ship Action vs Ship Line modifiers
rem (1)Caravel Line, (2)Corvette Line, (3)Galleon Line, (4)Carrack Line
DIM shiplines#(4,18)
rem (1)ship line, (2)ship mission, (3)ship captain type, (4)ship crew, (5)ship max crew
rem (6)ship crew training, (7)ship condition, (8)ship condition type, (9)ship morale
DIM shipstats#(2,9)
rem main loop
do
cls
if a#=1
print "Welcome to the DOEv3 battle program."
print "V0.04a"
print
print
a#=0
endif
if Mode#=0
print "No program mode has been selected."
print "Please choose from one of the modes below."
print
print "(1) Duel mode (Mode is currently unavailable.)"
print "(2) Land Battle mode (Mode is currently unavailable.)"
print "(3) Ship Battle mode"
print
Input "Mode select: "; Mode#
endif
if Mode#=3 then gosub Shipbattle_Mode
loop
Shipbattle_Mode:
cls
if ShipDataS=1; gosub ShipData_Setup
print "---------------------------------------------------------------------------------"
print "Ship Battle Mode"
print
print "(1) Change saved character stats."
print "(2) Select battle location."
print "(3) Edit the first ship."
print "(4) Edit the second ship."
print "(5) View the current battle settings."
print "(6) Run this battle."
print "(7) Return to mode selection."
print
Input "What would you like to do? "; Main#
cls
If Main#=0 then print "You need to choose an option."
If Main#=1 then gosub Characters
If Main#=7 then Mode#=0
Main#=0
return
Characters:
print "---------------------------------------------------------------------------------"
Input "What is the character name?";CName$
if file exist (CName$+".txt")
print "A character with that name is on file. View stats? (y/n)"
input "Choice: "; StatView$
else
print "No record exists for that character. Do you wish to create one? (y/n)"
input "Choice: "; NoRecord$
endif
if StatView$="y" then gosub ViewStats
if NoRecord$="y" then gosub AddStats
StatView$="n"
NoRecord$="n"
return
ViewStats:
cls
print "---------------------------------------------------------------------------------"
open to read 1, CName$+".txt"
read string 1,CName$
for T=1 to 6
read string 1,T$; charstats(11,T)=val(T$)
next T
print CName$
print "Command: "; charstats(11,1)
print "Strength: "; charstats(11,2)
print "Technique: "; charstats(11,3)
print "Intelligence: "; charstats(11,4)
print "Innovation: "; charstats(11,5)
print "Eloquence: "; charstats(11,6)
close file 1
print
input "Do you wish to edit this character? (y/n)"; edit$
if edit$="y" then gosub EditStats
edit$="n"
return
AddStats:
if file exist (CName$+".txt")
delete file (CName$+".txt")
endif
open to write 1, CName$+".txt"
write string 1, CName$
input "Command stat? "; T$
write string 1,T$
input "Strength stat? "; T$
write string 1, T$
input "Technique stat? "; T$
write string 1, T$
input "Intelligence stat? "; T$
write string 1, T$
input "Innovation stat? "; T$
write string 1, T$
input "Eloquence stat? "; T$
write string 1, T$
close file 1
return
EditStats:
return
ShipData_Setup:
rem ship mode data setup subroutine
rem load data for action vs action modifiers
rem (1)Assault vs
shipactions#(1,3)=0.1
shipactions#(1,6)=0.1
shipactions#(1,7)=-0.1
shipactions#(1,10)=-0.1
shipactions#(1,11)=0.1
shipactions#(1,12)=0.1
shipactions#(1,13)=0.1
shipactions#(1,14)=0.1
shipactions#(1,16)=0.1
shipactions#(1,17)=-0.1
shipactions#(1,18)=-0.1
rem (2)Barrage vs
shipactions#(2,7)=-0.1
shipactions#(2,8)=-0.1
rem (3)Board vs
shipactions#(3,1)=-0.1
shipactions#(3,3)=0.1
shipactions#(3,4)=-0.1
shipactions#(3,6)=0.1
shipactions#(3,10)=-0.1
shipactions#(3,13)=0.1
shipactions#(3,18)=-0.1
rem (4)Burning Volley vs
shipactions#(4,3)=0.1
shipactions#(4,7)=-0.1
shipactions#(4,8)=-0.1
rem (5)Burning Barrage vs
rem No action-related strengths or weaknesses
rem (6)Close In
shipactions#(6,1)=-0.1
shipactions#(6,3)=-0.1
shipactions#(6,10)=0.1
shipactions#(6,17)=0.1
rem (7)Evasion vs
shipactions#(7,1)=0.1
shipactions#(7,2)=0.1
shipactions#(7,4)=0.1
shipactions#(7,18)=0.1
rem (8)Extreme Evasion vs
shipactions#(8,2)=0.1
shipactions#(8,4)=0.1
shipactions#(8,18)=0.1
rem (9)Flaming Siege Shot vs
for T=1 to 18
shipactions#(T,9)=0.1
rem sets all other actions to strong vs this action
shipactions#(9,T)=-0.1
rem sets this action to weak vs all other actions
next T
shipactions#(9,10)=0.1
shipactions#(9,17)=0.1
rem (10)Flee vs
shipactions#(10,1)=0.1
shipactions#(10,3)=0.1
shipactions#(10,6)=-0.1
shipactions#(10,9)=-0.1
shipactions#(10,13)=-0.1
shipactions#(10,14)=0.1
shipactions#(10,15)=-0.1
shipactions#(10,16)=0.1
rem (11)Heavy Barrage vs
shipactions#(11,1)=-0.1
shipactions#(11,6)=0.1
shipactions#(11,7)=0.1
shipactions#(11,10)=0.1
shipactions#(11,14)=0.1
rem (12)Heavy Fire Barrage vs
shipactions#(12,1)=-0.1
shipactions#(12,3)=0.1
shipactions#(12,6)=0.1
shipactions#(12,7)=0.1
shipactions#(12,10)=0.1
shipactions#(12,12)=-0.1
shipactions#(12,14)=0.1
rem (13)Intercept vs
shipactions#(13,1)=-0.1
shipactions#(13,3)=-0.1
shipactions#(13,10)=0.1
shipactions#(13,17)=0.1
rem (14)Ram vs
shipactions#(14,1)=-0.1
shipactions#(14,10)=-0.1
shipactions#(14,12)=-0.1
rem (15)Siege Shot vs
for T=1 to 18
shipactions#(T,15)=0.1
rem sets all other actions to strong vs this action
shipactions#(15,T)=-0.1
rem sets this action to weak vs all other actions
next T
shipactions#(15,10)=0.1
shipactions#(15,17)=0.1
rem (16)Strategic Ram vs
shipactions#(16,1)=-0.1
rem (17)Strategic Withdrawl vs
shipactions#(17,1)=0.1
shipactions#(17,6)=-0.1
shipactions#(17,9)=-0.1
shipactions#(17,13)=-0.1
shipactions#(17,15)=-0.1
rem (18)Volley vs
shipactions#(18,1)=0.1
shipactions#(18,3)=0.1
shipactions#(18,7)=-0.1
shipactions#(18,8)=-0.1
rem load data for ship line vs action modifiers
rem Caravel Line vs action mods
shiplines#(1,2)=-0.1
shiplines#(1,4)=0.1
shiplines#(1,9)=-0.1
shiplines#(1,10)=-0.1
shiplines#(1,15)=-0.1
rem Corvette Line vs action mods
shiplines#(2,2)=0.1
shiplines#(2,4)=-0.1
shiplines#(2,5)=-0.1
shiplines#(2,15)=0.1
rem Galleon Line vs action mods
shiplines#(3,2)=-0.1
shiplines#(3,4)=-0.1
shiplines#(3,5)=-0.1
shiplines#(3,9)=-0.1
shiplines#(3,12)=-0.1
shiplines#(3,15)=-0.1
shiplines#(3,16)=-0.1
rem Carrack Line vs action mods
shiplines#(4,1)=-0.1
shiplines#(4,2)=-0.1
shiplines#(4,4)=-0.1
shiplines#(4,5)=-0.1
shiplines#(4,9)=-0.1
shiplines#(4,10)=-0.1
shiplines#(4,11)=-0.1
shiplines#(4,12)=-0.1
shiplines#(4,15)=-0.1
shiplines#(4,16)=-0.1
ShipDataS=0
return
You can see clearly that the problem is with a line in the Shipbattle_Mode procedure:
if ShipDataS=1; gosub ShipData_Setup
which should be:
if ShipDataS=1 Then gosub ShipData_Setup
With indented code, this literally took me around 10 seconds to find!
Your corrected and properly indented code:
a#=1
c#=1
T=0
T1=0
S=0
R=0
MoraleS1=1
MoraleS2=1
T$="n"
Main#=0
Mode#=0
ShipDataS=1
Terrain$=""
CName$="None."
StatView$="n"
NoRecord$="n"
edit$="n"
rem Command, Strength, Technique, Intelligence, Innovation, Eloquence
DIM charstats(11,6)
rem None set
DIM duelskills(1,1)
rem None set
DIM landskills(1,1)
rem None set
DIM shipskills(3,8)
rem Ship Action vs Action modifiers
rem (1)Assault, (2)Barrage, (3)Board, (4)Burning Volley, (5)Burning Barrage, (6)Close In
rem (7)Evasion, (8)Extreme Evasion, (9)Flaming Siege Shot, (10)Flee, (11)Heavy Barrage
rem (12)Heavy Fire Barrage, (13)Intercept, (14)Ram, (15)Siege Shot, (16)Strategic Ram
rem (17)Strategic Withdrawl, (18)Volley
DIM shipactions#(18,18)
rem Ship Action vs Ship Line modifiers
rem (1)Caravel Line, (2)Corvette Line, (3)Galleon Line, (4)Carrack Line
DIM shiplines#(4,18)
rem (1)ship line, (2)ship mission, (3)ship captain type, (4)ship crew, (5)ship max crew
rem (6)ship crew training, (7)ship condition, (8)ship condition type, (9)ship morale
DIM shipstats#(2,9)
rem main loop
do
cls
if a#=1
print "Welcome to the DOEv3 battle program."
print "V0.04a"
print
print
a#=0
endif
if Mode#=0
print "No program mode has been selected."
print "Please choose from one of the modes below."
print
print "(1) Duel mode (Mode is currently unavailable.)"
print "(2) Land Battle mode (Mode is currently unavailable.)"
print "(3) Ship Battle mode"
print
Input "Mode select: "; Mode#
endif
if Mode#=3 then gosub Shipbattle_Mode
loop
Shipbattle_Mode:
cls
if ShipDataS=1 Then gosub ShipData_Setup
print "---------------------------------------------------------------------------------"
print "Ship Battle Mode"
print
print "(1) Change saved character stats."
print "(2) Select battle location."
print "(3) Edit the first ship."
print "(4) Edit the second ship."
print "(5) View the current battle settings."
print "(6) Run this battle."
print "(7) Return to mode selection."
print
Input "What would you like to do? "; Main#
cls
If Main#=0 then print "You need to choose an option."
If Main#=1 then gosub Characters
If Main#=7 then Mode#=0
Main#=0
return
Characters:
print "---------------------------------------------------------------------------------"
Input "What is the character name?";CName$
if file exist (CName$+".txt")
print "A character with that name is on file. View stats? (y/n)"
input "Choice: "; StatView$
else
print "No record exists for that character. Do you wish to create one? (y/n)"
input "Choice: "; NoRecord$
endif
if StatView$="y" then gosub ViewStats
if NoRecord$="y" then gosub AddStats
StatView$="n"
NoRecord$="n"
return
ViewStats:
cls
print "---------------------------------------------------------------------------------"
open to read 1, CName$+".txt"
read string 1,CName$
for T=1 to 6
read string 1,T$; charstats(11,T)=val(T$)
next T
print CName$
print "Command: "; charstats(11,1)
print "Strength: "; charstats(11,2)
print "Technique: "; charstats(11,3)
print "Intelligence: "; charstats(11,4)
print "Innovation: "; charstats(11,5)
print "Eloquence: "; charstats(11,6)
close file 1
print
input "Do you wish to edit this character? (y/n)"; edit$
if edit$="y" then gosub EditStats
edit$="n"
return
AddStats:
if file exist (CName$+".txt")
delete file (CName$+".txt")
endif
open to write 1, CName$+".txt"
write string 1, CName$
input "Command stat? "; T$
write string 1,T$
input "Strength stat? "; T$
write string 1, T$
input "Technique stat? "; T$
write string 1, T$
input "Intelligence stat? "; T$
write string 1, T$
input "Innovation stat? "; T$
write string 1, T$
input "Eloquence stat? "; T$
write string 1, T$
close file 1
return
EditStats:
return
ShipData_Setup:
rem ship mode data setup subroutine
rem load data for action vs action modifiers
rem (1)Assault vs
shipactions#(1,3)=0.1
shipactions#(1,6)=0.1
shipactions#(1,7)=-0.1
shipactions#(1,10)=-0.1
shipactions#(1,11)=0.1
shipactions#(1,12)=0.1
shipactions#(1,13)=0.1
shipactions#(1,14)=0.1
shipactions#(1,16)=0.1
shipactions#(1,17)=-0.1
shipactions#(1,18)=-0.1
rem (2)Barrage vs
shipactions#(2,7)=-0.1
shipactions#(2,8)=-0.1
rem (3)Board vs
shipactions#(3,1)=-0.1
shipactions#(3,3)=0.1
shipactions#(3,4)=-0.1
shipactions#(3,6)=0.1
shipactions#(3,10)=-0.1
shipactions#(3,13)=0.1
shipactions#(3,18)=-0.1
rem (4)Burning Volley vs
shipactions#(4,3)=0.1
shipactions#(4,7)=-0.1
shipactions#(4,8)=-0.1
rem (5)Burning Barrage vs
rem No action-related strengths or weaknesses
rem (6)Close In
shipactions#(6,1)=-0.1
shipactions#(6,3)=-0.1
shipactions#(6,10)=0.1
shipactions#(6,17)=0.1
rem (7)Evasion vs
shipactions#(7,1)=0.1
shipactions#(7,2)=0.1
shipactions#(7,4)=0.1
shipactions#(7,18)=0.1
rem (8)Extreme Evasion vs
shipactions#(8,2)=0.1
shipactions#(8,4)=0.1
shipactions#(8,18)=0.1
rem (9)Flaming Siege Shot vs
for T=1 to 18
shipactions#(T,9)=0.1
rem sets all other actions to strong vs this action
shipactions#(9,T)=-0.1
rem sets this action to weak vs all other actions
next T
shipactions#(9,10)=0.1
shipactions#(9,17)=0.1
rem (10)Flee vs
shipactions#(10,1)=0.1
shipactions#(10,3)=0.1
shipactions#(10,6)=-0.1
shipactions#(10,9)=-0.1
shipactions#(10,13)=-0.1
shipactions#(10,14)=0.1
shipactions#(10,15)=-0.1
shipactions#(10,16)=0.1
rem (11)Heavy Barrage vs
shipactions#(11,1)=-0.1
shipactions#(11,6)=0.1
shipactions#(11,7)=0.1
shipactions#(11,10)=0.1
shipactions#(11,14)=0.1
rem (12)Heavy Fire Barrage vs
shipactions#(12,1)=-0.1
shipactions#(12,3)=0.1
shipactions#(12,6)=0.1
shipactions#(12,7)=0.1
shipactions#(12,10)=0.1
shipactions#(12,12)=-0.1
shipactions#(12,14)=0.1
rem (13)Intercept vs
shipactions#(13,1)=-0.1
shipactions#(13,3)=-0.1
shipactions#(13,10)=0.1
shipactions#(13,17)=0.1
rem (14)Ram vs
shipactions#(14,1)=-0.1
shipactions#(14,10)=-0.1
shipactions#(14,12)=-0.1
rem (15)Siege Shot vs
for T=1 to 18
shipactions#(T,15)=0.1
rem sets all other actions to strong vs this action
shipactions#(15,T)=-0.1
rem sets this action to weak vs all other actions
next T
shipactions#(15,10)=0.1
shipactions#(15,17)=0.1
rem (16)Strategic Ram vs
shipactions#(16,1)=-0.1
rem (17)Strategic Withdrawl vs
shipactions#(17,1)=0.1
shipactions#(17,6)=-0.1
shipactions#(17,9)=-0.1
shipactions#(17,13)=-0.1
shipactions#(17,15)=-0.1
rem (18)Volley vs
shipactions#(18,1)=0.1
shipactions#(18,3)=0.1
shipactions#(18,7)=-0.1
shipactions#(18,8)=-0.1
rem load data for ship line vs action modifiers
rem Caravel Line vs action mods
shiplines#(1,2)=-0.1
shiplines#(1,4)=0.1
shiplines#(1,9)=-0.1
shiplines#(1,10)=-0.1
shiplines#(1,15)=-0.1
rem Corvette Line vs action mods
shiplines#(2,2)=0.1
shiplines#(2,4)=-0.1
shiplines#(2,5)=-0.1
shiplines#(2,15)=0.1
rem Galleon Line vs action mods
shiplines#(3,2)=-0.1
shiplines#(3,4)=-0.1
shiplines#(3,5)=-0.1
shiplines#(3,9)=-0.1
shiplines#(3,12)=-0.1
shiplines#(3,15)=-0.1
shiplines#(3,16)=-0.1
rem Carrack Line vs action mods
shiplines#(4,1)=-0.1
shiplines#(4,2)=-0.1
shiplines#(4,4)=-0.1
shiplines#(4,5)=-0.1
shiplines#(4,9)=-0.1
shiplines#(4,10)=-0.1
shiplines#(4,11)=-0.1
shiplines#(4,12)=-0.1
shiplines#(4,15)=-0.1
shiplines#(4,16)=-0.1
ShipDataS=0
return
TDK_Man