Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Need help saving and loading here's how.

Author
Message
Phoenix Software
19
Years of Service
User Offline
Joined: 14th Nov 2005
Location: The Game Daemon Testing Labs :)
Posted: 5th Dec 2005 19:46
`Simple Save and Retrieve
`Version - 1.0
`By **Name Erased**

input "name> ";name$

dim namea$(1)
namea$(1) = name$

input "file location,name,extension> ";file$

Print "saving as array"
save array file$,namea$(1)

Print "now saving as a text file"

open to write 1,file$
if file exist(file$) = 1 then delete file file$
write string 1,name$

close file 1

Print "All done!"

Print "Now then I'll reload it for you pal!"

Print "As an array: "
load array file$,namea$(1)
Print "Your name was: ";namea$(1)

Print "As a text file: "
open to read 1,file$
read string 1,name$
close file 1
Print "Your name was: ";name$

Print "There ya go bob's your uncle! Hope This Helped!"

Visit My Pointless Blog http://programmersblogjonman.blogspot.com/
Upcoming Software: Phoenix RPG Creation Kit Release Date: February 2006 Using: DarkBASIC Classic
DrewG
19
Years of Service
User Offline
Joined: 25th Aug 2005
Location:
Posted: 5th Dec 2005 21:18
No offence, this looks a LOT like of what I posted here a while ago. I mean, my saving file. And you can find this in the codebase as well, hope you didn't take someones work, change it, and repost it...

Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 5th Dec 2005 21:24
I too posted a "File tutorial" on the newcomers forum, not so long ago.


I can't be fired... Slaves are SOLD!

Login to post a reply

Server time is: 2024-11-23 11:16:09
Your offset time is: 2024-11-23 11:16:09