Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I make A program that saves the persons work when ...
#1
How do I make A program save for when a person exit?

Note : I take so many tuts and none stay in my head!
~~~~~~~~~~~~~~~~~~~~~~~~~~

I love Quick Basic better then Python...

And Python is new.........

Oh yea catch ARPGME
Reply
#2
Hi arpgme,

Have a look at the following 3 tutorials I wrote about file manipulation in quick basic and freebasic too. I think they'll answer, in alot of details, your question: :-) I suggestion you start with the first, then the second and finaly the 3rd. This order is somewhat by level of difficulty :-).

Sequential file handling:
http://www.petesqbsite.com/sections/expr...#filemanip

Random Access File manipulation:
http://www.petesqbsite.com/sections/expr...ccessfiles

Binary file manipulation:
http://www.petesqbsite.com/sections/expr...inaryfiles

This is a 3 part series I did on file manipulation for the QB Express magazine :-).

Hope this helps :-)
hen they say it can't be done, THAT's when they call me ;-).

[Image: kaffee.gif]
[Image: mystikshadows.png]

need hosting: http://www.jc-hosting.net
All about ASCII: http://www.ascii-world.com
Reply
#3
Quote:How do I make A program save after they use it? .....

Don't understand.

Do you want to save the source code of the program?

What do you mean by "after they use it"? Do you want your program to write out some sort of audit trail or log, so you can review it later to see what the user did? If so, you have to build this capability into the program.

Just a tip: Don't mix topics in your post. The stuff about Python has nothing to do with your question. If you mix topics, you are liable to get replies about Python, and not about your question. Ok?
*****
Reply
#4
If I make a game and they play it for aa while and is ready to quit,how can I make a function to save the game?
~~~~~~~~~~~~~~~~~~~~~~~~~~

I love Quick Basic better then Python...

And Python is new.........

Oh yea catch ARPGME
Reply
#5
Actually, Python and QuickBASIC were made around the same time... QuickBASIC seeing its first release in 1983, with the QB you know (4.5 & 1.1) being written in 1987 and 1991. Python was written in the mid-80s. Newer scripting languages are PHP and Ruby, and I guess sort of, Lua.

As for saving your state, you have to first look at the variables your program is using right then:
Player position
Health
Location
Etc

and then save those variables.
Reply
#6
You could do something like this:

If press$ = chr$(27) then
Open "savegame.dat" for output as #1
Print #1, health, money, strength
Print #1, xcoord, ycoord
endif
Close #1
END
quote="na_th_an"]
Greenday, Spice Girls... Can you tell the difference?
[/quote]
Reply
#7
And loading... =D

If press$ = "L" then
Open "savegame.dat" for input as #1
Input #1, health, money, strength
Input #1, xcoord, ycoord
endif
Close #1
END
Reply
#8
That dont work!
~~~~~~~~~~~~~~~~~~~~~~~~~~

I love Quick Basic better then Python...

And Python is new.........

Oh yea catch ARPGME
Reply
#9
no.

thats like saying a gear doesnt work because you havent designed a machine yet to make it spin.

saving/loading is something you should learn to do after you are already comfortable manipulating and storing data, just learn more about variables, and experiment (like anything you wanna be really good at)
Reply
#10
Quote:That dont work!

What happens? It should work fine. Or are you just saying that because it doesn't specifically suit your program?
quote="na_th_an"]
Greenday, Spice Girls... Can you tell the difference?
[/quote]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)