09-05-2003, 07:04 PM
Perhaps replacing:
by:
Helps.
You'll thus get this:
I've not used PRINT USING so much, so I can't predict if there's a mistake in the mask you set in tmp$. But according to me, this should work.
Code:
WRITE #1, day$, Kms, min, Speed
Code:
PRINT #1, day$ + STR$(Kms) + STR$(min) + STR$(Speed)
You'll thus get this:
Code:
CLS
OPEN "Record.rec" FOR APPEND AS #1
CLS
PRINT "Cycling Record"
PRINT "type END to quit"
PRINT
DO WHILE (day$ <> "END")
INPUT "Date ", day$
IF (day$ <> "END") THEN
INPUT "Kilometres ", Kms!
INPUT "Minutes", min!
Speed! = Kms! / (min! / 60.0)
PRINT #1, day$ + STR$(Kms!) + STR$(min!) + STR$(Speed!)
END IF
PRINT
LOOP
CLOSE #1
INPUT "Press Enter to see the Total Record", dummy
CLS
OPEN "Record.rec" FOR INPUT AS #1
PRINT "Date Kms Mins Av.Speed "
PRINT "---------------------------------"
tmp$ = "\ \ ### ### ####.# "
WHILE NOT EOF(1)
INPUT #1, day$, Kms!, min!, Speed!
PRINT USING tmp$; day$; Kms!; min!; Speed!
WEND
CLOSE #1
I've not used PRINT USING so much, so I can't predict if there's a mistake in the mask you set in tmp$. But according to me, this should work.