hmmm Ive been working for a while to try to figure out how to get my input created into something writeable to a file then pull from what was written. But ive been having trouble since it just keeps putting 000000 whenever im loading the string so I must of made an error some where... but cant figure out where... Ive tried several diffrent ways and have made it this far but this 000000 has me stumped... Thanks in advance
P.S. As you can see theres allot missing in the code but im mostly tring to figure out the write/save till I move further into the other stuff.
Rem Pulled Data
Pro$="Pro.txt"
if file exist (Pro$) then gosub Badz
if file exist (Pro$)=0 then make file "Pro.txt"
Print "Please Log In"
open to write 2, "Pro.txt"
Input "Pro2"
write string 2, str$(Pro2)
close file 2
if keystate(28) then gosub Badz
Rem GoSubs
Gosub Badz
Gosub newdoc
Gosub opendoc
Badz:
Print "Press 1 to Create A New Document."
Print "Press 2 to Open A Previous Document."
Print "Press Escape to exit."
Print ""
Print ""
command()
function command()
do
if commands=0
if keystate(2)=1 then gosub newdoc
if keystate(3)=1 then gosub opendoc
endif
loop
sync
exit
endfunction
Rem New Document
newdoc:
profile$="Profile.dec"
if file exist (Profile$)=0 then make file (Profile$)
open to write 1, "Profile.dec"
Print "Date: "
input "date"
if keystate(28) then GOTO Nxt1
Nxt1:
Print ""
Print "Stock Name: "
input "stkname"
if keystate(28) then GOTO Nxt2
Nxt2:
Print ""
Print "Ending Price: "
input "pricend"
if keystate(28) then GOTO Save
Print ""
Print "Save? y=yes n=no"
Save:
write string 1,str$(date)
write string 1,str$(stkname)
write string 1,str$(pricend)
close file 1
command()
opendoc:
close file 1
open to read 1, "Profile.dec"
read string 1,str$(date)
read string 1,str$(stkname)
read string 1,str$(pricend)
print ""; str$(date)
close file 1
command()
P.S.S. heheh btw im making this to make my life easyer in recording info for my economics class
When catapults are outlawed, only outlaws will have catapults. I have a catapult. Give me all the money, or I will fling an enormous rock at your head.