this program is suposed to print all of the months data, then stop and ask for user input after the change of every month....
but the month$ and month.hold$ are not reading right
please help!
GOSUB HSK
WHILE END.FLAG <> 1
GOSUB PROCESS
WEND
GOSUB EOJ
END
HSK:
CLS
END.FLAG = 0
H1$ = " NAME DATE OF APPLICATION COST REVENUE PROFIT"
D1$ = "\ \ \ \ $$#,###.## $$#,###.## $$#,###.##"
T1$ = " $$#,###.##"
GOSUB READ.REC
GOSUB HEADS
RETURN
READ.REC:
IF NAME$ = "EOF" THEN
END.FLAG = 1
ELSE
READ NAME$, d$, FERT, WEED, INSECT, FERTU, WEEDU, INSECTU, TOTAL
P = INSTR(d$, "/")
MONTH$ = LEFT$(d$, P)
IF MONTH$ <> MONTH.HOLD$ THEN
GOSUB NEW.PAGE
END IF
END IF
RETURN
HEADS:
CLS
PRINT TAB(24); "LAWN CARE PROFIT REPORT"
PRINT H1$
RETURN
MONTH.CHECK:
IF MONTH$ <> MONTH.HOLD$ THEN
MONTH$ = MONTH.HOLD$
GOSUB HEADS
END IF
RETURN
PROCESS:
IF MONTH$ <> MONTH.HOLD$ THEN
GOSUB MONTH.CHECK
END IF
IF MONTH$ = MONTH.HOLD$ THEN
COST = (FERT * FERTU) + (WEED * WEEDU) + (INSECT * INSECTU)
PRINT USING D1$; NAME$; d$; COST; TOTAL; TOTAL - COST
TOTAL.PROFIT = TOTAL + TOTAL.PROFIT
ELSE
GOSUB NEW.PAGE
END IF
GOSUB READ.REC
RETURN
NEW.PAGE:
IF MONTH$ <> MONTH.HOLD$ THEN
INPUT "PRESS ANY KEY TO CONTINUE..."; ANYKEY$
MONTH$ = MONTH.HOLD$
END IF
RETURN
EOJ:
PRINT
PRINT USING T1$; TOTAL.PROFIT
PRINT "END OF REPORT"
RETURN
DATA Willie Abney, 10/1/2002, 2.42, 8.18, 6.72, 11, 11.9, 0.3, 200
DATA John Acher, 10/2/2002, 3.74, 11.35, 5.63, 11.3, 11.8, 16.3, 500
DATA Amber Averbeck, 10/2/2002, 5.5, 2.56, 14.22, 15.7, 8.2, 16.1, 300
DATA Kenneth Becker, 10/2/2002, 1.37, 11.47, 3.44, 17.7, 7.3, 5.6, 100
DATA Angela Browning, 10/10/2002, 1.99, 7.06, 13.78, 14.5, 16.5, 19.4, 400
DATA Glenn Browning, 10/10/2002, 5.73, 2.24, 7.98, 0.6, 16.9, 5, 100
DATA Carl Buckey, 10/15/2002, 3.92, 6.99, 3.89, 6.5, 15.9, 7.7, 225
DATA Carrie Corrie, 10/15/2002, 3.49, 4.92, 7.29, 8.5, 0.9, 14.7, 175
DATA Casey Dempsey, 10/22/2002, 4.27, 7.61, 7.83, 12.6, 20.4, 16.6, 300
DATA Eugene Dodson, 10/22/2002, 5.78, 1.25, 1.45, 6.7, 12, 9.2, 100
DATA Brian Eberle, 10/22/2002, 3.22, 6.33, 11.16, 1.4, 2.9, 3.1, 100
DATA Dennis Feist, 10/25/2002, 0.58, 6.47, 2.46, 12, 10.6, 5.4, 100
DATA James Feller, 10/26/2002, 3.52, 4.83, 7.6, 5, 4, 5.4, 100
DATA Brandy Hagen, 10/26/2002, 2.32, 5.95, 13.9, 20.8, 15, 6.2, 150
DATA Barnell Hamby, 10/26/2002, 4.62, 6.46, 9.58, 9, 10.7, 8.9, 150
DATA Donald Hardbeck, 10/26/2002, 3.42, 10.96, 6.49, 12.1, 5.8, 0.8, 100
DATA Larry Kershaw, 11/2/2002, 3.26, 3.56, 1.03, 16.6, 18.7, 19.2, 150
DATA Ron Harned, 11/12/2002, 5.65, 5.95, 4.4, 2.1, 16.9, 1.4, 200
DATA Carl Johnes, 11/15/2002, 5.06, 7.96, 6.34, 17.9, 15.4, 9.3, 350
DATA Arthur Kamm, 11/22/2002, 0.55, 8.06, 8.2, 13.8, 9.1, 12.8, 200
DATA David Leuty, 3/2/2003, 5.05, 6.84, 12.3, 2.2, 2.6, 18.5, 200
DATA Lee Link, 3/4/2003, 3.64, 0.35, 1.29, 4.2, 8.9, 17.4, 100
DATA Fred Long, 3/4/2003, 3.32, 10.93, 3.66, 5.5, 20.6, 0.8, 250
DATA Elmer Matthews, 3/5/2003, 0.29, 6.11, 5.79, 13.8, 18.6, 1.3, 200
DATA Peter Kohn, 3/15/2003, 3.64, 9.73, 12.4, 21.6, 20.6, 14.1, 600
DATA Dorothy Larkin, 3/15/2003, 5.69, 7.68, 1.14, 13.8, 6.5, 20.3, 200
DATA Barbara Letts, 3/15/2003, 5.75, 8.36, 13.19, 18.5, 4, 4.3, 200
DATA Robert Meunher, 3/25/2003, 2.27, 2.77, 5.2, 19.5, 6.9, 20.7, 150
DATA Bryan O'leary, 3/25/2003, 3.85, 2.1, 8.22, 3.2, 11.2, 4.8, 100
DATA Thomas Powers, 4/2/2003, 3.06, 9.22, 6.21, 2.7, 7, 11.5, 100
DATA James Robins, 4/2/2003, 2.69, 6.16, 9.71, 9.1, 19.3, 1.2, 250
DATA Paul Schweiss, 4/2/2003, 0.69, 10.32, 4.63, 15.8, 14.9, 12.3, 275
DATA John Thompson, 4/2/2003, 2.1, 7.52, 5.19, 3.3, 0.1, 22, 200
DATA Jean Thomas, 4/2/2003, 0.99, 5.23, 14.28, 8.6, 13.1, 12.1, 300
DATA Robert Trentman, 4/2/2003, 2.78, 4.32, 2.08, 2.9, 15.3, 21.1, 250
DATA Mark Vigil, 4/2/2003, 0.6, 5.28, 0.8, 9.2, 11.2, 18.1, 100
DATA Donald Vitali, 4/2/2003, 4.77, 10.38, 11.52, 7.5, 14.7, 8.5, 400
DATA Earl Struense, 4/12/2003, 0.74, 4.8, 5.69, 12.6, 12.3, 12.5, 200
DATA Tara Struense, 4/12/2003, 5.53, 10.83, 12.29, 12.5, 8, 3.2, 250
DATA Albert Theis, 4/15/2003, 5.91, 2.16, 12.44, 0.3, 19.8, 8.4, 200
DATA Amy York, 5/1/2003, 1.24, 1.5, 6.18, 1.7, 8.5, 12.1, 100
DATA Adolph Von Hade, 5/2/2003, 4.95, 11.81, 13.13, 10.3, 16.6, 9, 500
DATA Andrea Voss, 5/2/2003, 1.73, 11.66, 11.73, 14.5, 15.8, 13.7, 500
DATA David Vost, 5/2/2003, 3.68, 3.62, 7.81, 19, 3.1, 19.2, 200
DATA Annie Ware, 5/2/2003, 0.08, 5.63, 6.07, 21.5, 20.1, 5.1, 500
DATA Faye Walko, 5/10/2003, 4.36, 7.29, 10.85, 9.2, 5.4, 10.4, 300
DATA Benita Walker, 5/11/2003, 3.62, 1.51, 4.7, 15.3, 3, 17.5, 100
DATA Brian Warner, 5/22/2003, 1.21, 5.49, 3.46, 0.1, 1.6, 11.5, 100
DATA Helen Yerk, 5/27/2003, 1.48, 0.13, 5.64, 7.5, 3, 4.5, 100
DATA Bernard Yoch, 5/30/2003, 1.71, 0.01, 5.17, 1.4, 1.1, 10.6, 100
DATA EOF,0,0,0,0,0,0,0,0
RETURN
variables keep disappearing
Moderators:Administrator, Global Moderator
Re: variables keep disappearing
figured it out myself..........stupid logic mistake
insted of
month$ = month.check$
it should read...
month.check$ = month$
thanx anyway
john :-[
insted of
month$ = month.check$
it should read...
month.check$ = month$
thanx anyway
john :-[