09-06-2003, 01:01 AM
You can keep the data entry part as it is, but modify the result printing part like this:
I have written it directly on the reply window, it may have some error...
Code:
OPEN "Record.rec" FOR INPUT AS #1
PRINT "Date Kms Mins Av.Speed "
PRINT "---------------------------------"
tmp$ = "\ \ ### ### ####.# "
tmp2$ = "\ \ ### ### ####.# in Total"
DO
TotKms=0:totMin=0
DO
IF EOF(1) THEN GOTO finish
INPUT #1, day$, Kms, min, Speed
PRINT USING tmp$; day$; Kms; min; Speed
IF day$=oldday$ THEN
totkms=totkms+kms
totmin=totmin+min
ELSE
day$=oldday$
EXIT DO
ENDIF
LOOP
PRINT USING tmp2$; day$; TotKms; Totmin; TotKms*60/Totmin
PRINT
LOOP
finish:
CLOSE #1
Antoni