I'm working on a rpg and am trying to code a system that saves the current system date & time when you save & quit game
then when you load up game again, it gets current date & time, and works out how long since you've played the game
But the problem is the get time$() and get date$() commands are string, i've tried using val command, but it only grabs the first part of the date up to the / ie, 04/22/10 it just reports back 04
How do i make the val command read the rest of the date & time?
Any suggestions or help would be appreciated.
This is the code i have so far
currentdate$=get date$()
currenttime$=get time$()
sync rate 0
do
if inkey$()="1"
open to write 1,"date.dat"
write string 1,currentdate$
write string 1,currenttime$
ink rgb(255,255,0),rgb(0,0,0)
set cursor 0,0:print currentdate$
set cursor 0,50:print currenttime$
endif
If inkey$()="2"
if notread=0
open to read 1,"date.dat"
read string 1,saveddate$
read string 1,savedtime$
endif
notread=1
ink rgb(255,255,255),rgb(0,0,0)
set cursor 0,0:print saveddate$
set cursor 0,20:print savedtime$
endif
cls
set cursor 0,0:print saveddate$
set cursor 0,20:print savedtime$
set cursor 0,40:print currentdate$
set cursor 0,60:print currenttime$
dateoffline=val(saveddate$)
timeoffline=val(savedtime$)