PLEASE HELP ME! :S
Posted: Fri Dec 13, 2002 1:06 am
I have a program that keeps giving me a syntax error. I've had my professor go through it, and most of my classmates, as well as a few other people & NOBODY can find what is wrong...Is anyone online now that can help me? If so, please send me a message via MSN messenger-- princesshinmighty@hotmail.com
Thanks!
Here is the code:
'*****************************************
'*** Main Driver ***
'** This is the main driver for the **
'* Program. *
'*****************************************
GOSUB INIT
GOSUB BUILDIT
GOSUB HEAD
LOOPIT:
GOSUB READIT
GOSUB TABLECHECK
GOSUB PRINTIT
GOTO LOOPIT
'
'****************************************
'******** Initialization **************
'This initializes & sets up the variables for the program
'****************************************
'
INIT:
CLS
MSG$ = ""
BSTS = 0
BSFS = 0
BSRS = 0
BSXS = 0
DCT = 0
TOTP = 0
TOTET = 0
'
'RETURN
'
'****BUILDIT*****
'
BUILDIT:
FOR I = 1 TO 10
'
READ BI(I), ET$(I), DY$(I), RT$(I)
DATA 01, "B747", "T-2", "ORD-DEN"
DATA 02, "B727", "M-T", "DEN-HNL"
DATA 03, "B727", "F-S", "PIT-HNL"
DATA 04, "B737", "SAT", "DSM-OMA"
DATA 05, "B737", "THU", "PIT-HNL"
DATA 06, "B767", "F-SS", "LAX-TYK"
DATA 07, "B747", "W-S", "ORD-LAX"
DATA 08, "DC10", "SUN", "SFO-SEA"
DATA 09, "DC10", "T-W", "SAN-MAM"
DATA 10, "B727", "MON", "LAX-SFO"
NEXT I
'
RETURN
'
'*****HEAD*********
'
HEAD:
PRINT TAB(30); "Fly Right Corporation"
PRINT TAB(31); "Pilot Bid Report"
PRINT
PRINT
PRINT TAB(12); "Bid"; TAB(20); "Pilot's Name"; TAB(37); "Equipment"; TAB(51); "Days Off"; TAB(64); "Route"
PRINT
PRINT
RETURN
'
'*****READIT*******
'
READIT:
READ PN$, BD
DATA "Cyle Adams", 10
DATA "David Berry", 02
DATA "Frank Cone", 07
DATA "George Smiti", 11
DATA "Henry Jordan", 04
DATA "Isaac New", 05
DATA "Ken Phillip",03
DATA "Mike Smith", 01
DATA "Ned Turner", 15
DATA "Tim Snider", 08
DATA END, 999
IF PN$ = "END" THEN GOTO ENDIT
'
'****TABLECHECK****
TABLECHECK:
TOTET = TOTET + 1
'
FOR I = 1 TO 10
IF BD(I) = BI(N) THEN GOTO CALCS
IF BD(I) = 10 THEN MSG$ = "Invalid Bid!": GOTO RETURNIT
GOTO BUMPIT
CALCS:
TOTP = TOTP + 1
IF ET$(N) = "B727" THEN BSTS = BSTS + 1: GOTO RETURNIT
IF ET$(N) = "B747" THEN BSFS = BSFS + 1: GOTO RETURNIT
IF ET$(N) = "B737" THEN BSRS = BSRS + 1: GOTO RETURNIT
IF ET$(N) = "B767" THEN BSXS = BSXS + 1: GOTO RETURNIT
IF ET$(N) = "DC10" THEN DCT = DCT + 1: GOTO RETURNIT
'
BUMPIT:
NEXT I
'
RETURNIT:
RETURN
'
'********PRINT***
PRINTIT:
PRINT TAB(12); BD; TAB(20); PN$; TAB(39); ET$(I); TAB(53); DY$(I); TAB(63); RT$(I);
PRINT TAB(22); MSG$
PRINT
MSG$ = ""
RETURN
'
'****END****
ENDIT:
PRINT
PRINT
PRINT TAB(32); "Equipment Totals"
PRINT
PRINT TAB(33); "Type"; TAB(42); "Total"
PRINT TAB(33); "B747"; TAB(43); BSFS
PRINT TAB(33); "B727"; TAB(43); BSTS
PRINT TAB(33); "B737"; TAB(43); BSRS
PRINT TAB(33); "B767"; TAB(43); BSXS
PRINT TAB(33); "DC10"; TAB(43); DCT
PRINT
PRINT
PRINT TAB(33); "Total Planes:"; TAB(48); TOTET
PRINT TAB(33); "Total Pilots"; TAB(48); TOTP
END
Thanks!
Here is the code:
'*****************************************
'*** Main Driver ***
'** This is the main driver for the **
'* Program. *
'*****************************************
GOSUB INIT
GOSUB BUILDIT
GOSUB HEAD
LOOPIT:
GOSUB READIT
GOSUB TABLECHECK
GOSUB PRINTIT
GOTO LOOPIT
'
'****************************************
'******** Initialization **************
'This initializes & sets up the variables for the program
'****************************************
'
INIT:
CLS
MSG$ = ""
BSTS = 0
BSFS = 0
BSRS = 0
BSXS = 0
DCT = 0
TOTP = 0
TOTET = 0
'
'RETURN
'
'****BUILDIT*****
'
BUILDIT:
FOR I = 1 TO 10
'
READ BI(I), ET$(I), DY$(I), RT$(I)
DATA 01, "B747", "T-2", "ORD-DEN"
DATA 02, "B727", "M-T", "DEN-HNL"
DATA 03, "B727", "F-S", "PIT-HNL"
DATA 04, "B737", "SAT", "DSM-OMA"
DATA 05, "B737", "THU", "PIT-HNL"
DATA 06, "B767", "F-SS", "LAX-TYK"
DATA 07, "B747", "W-S", "ORD-LAX"
DATA 08, "DC10", "SUN", "SFO-SEA"
DATA 09, "DC10", "T-W", "SAN-MAM"
DATA 10, "B727", "MON", "LAX-SFO"
NEXT I
'
RETURN
'
'*****HEAD*********
'
HEAD:
PRINT TAB(30); "Fly Right Corporation"
PRINT TAB(31); "Pilot Bid Report"
PRINT TAB(12); "Bid"; TAB(20); "Pilot's Name"; TAB(37); "Equipment"; TAB(51); "Days Off"; TAB(64); "Route"
RETURN
'
'*****READIT*******
'
READIT:
READ PN$, BD
DATA "Cyle Adams", 10
DATA "David Berry", 02
DATA "Frank Cone", 07
DATA "George Smiti", 11
DATA "Henry Jordan", 04
DATA "Isaac New", 05
DATA "Ken Phillip",03
DATA "Mike Smith", 01
DATA "Ned Turner", 15
DATA "Tim Snider", 08
DATA END, 999
IF PN$ = "END" THEN GOTO ENDIT
'
'****TABLECHECK****
TABLECHECK:
TOTET = TOTET + 1
'
FOR I = 1 TO 10
IF BD(I) = BI(N) THEN GOTO CALCS
IF BD(I) = 10 THEN MSG$ = "Invalid Bid!": GOTO RETURNIT
GOTO BUMPIT
CALCS:
TOTP = TOTP + 1
IF ET$(N) = "B727" THEN BSTS = BSTS + 1: GOTO RETURNIT
IF ET$(N) = "B747" THEN BSFS = BSFS + 1: GOTO RETURNIT
IF ET$(N) = "B737" THEN BSRS = BSRS + 1: GOTO RETURNIT
IF ET$(N) = "B767" THEN BSXS = BSXS + 1: GOTO RETURNIT
IF ET$(N) = "DC10" THEN DCT = DCT + 1: GOTO RETURNIT
'
BUMPIT:
NEXT I
'
RETURNIT:
RETURN
'
'********PRINT***
PRINTIT:
PRINT TAB(12); BD; TAB(20); PN$; TAB(39); ET$(I); TAB(53); DY$(I); TAB(63); RT$(I);
PRINT TAB(22); MSG$
MSG$ = ""
RETURN
'
'****END****
ENDIT:
PRINT TAB(32); "Equipment Totals"
PRINT TAB(33); "Type"; TAB(42); "Total"
PRINT TAB(33); "B747"; TAB(43); BSFS
PRINT TAB(33); "B727"; TAB(43); BSTS
PRINT TAB(33); "B737"; TAB(43); BSRS
PRINT TAB(33); "B767"; TAB(43); BSXS
PRINT TAB(33); "DC10"; TAB(43); DCT
PRINT TAB(33); "Total Planes:"; TAB(48); TOTET
PRINT TAB(33); "Total Pilots"; TAB(48); TOTP
END