-
March 19th, 2003, 09:42 PM
#1
Help With Saving Files Please!!
HI,
I have made a program that is like a tamagotchi. you have a choice of ten different pets. Now what i want it to do is save the pet stats and the pet name and picture.
This si what i had before, but it wont work because then you can only save one pet at a time.
On Error GoTo fileerror
Open "savedpet.sp" For Output As #1
Print #1, weight; health; happy; hunger; lke; dis; age; Form2.petpic; Form2.pet
Close #1
Exit Sub
fileerror:
MsgBox "Error saving pet", vbCritical
The words on the print line are variables with numbers.
I need to know how to save it, but so one of those boxes appear and asks you where to put the file and specify a file name too.
Also do this for load so the user can choose which pet to load.
Thanx alot for the help all.
Im only a beginner! So plz be willing to help me!
A good site 4 vb source code: www.a1vbcode.com
cya ;-)
-
March 19th, 2003, 09:43 PM
#2
ALSO
ALso,
Would i have to insert the COMDLG32.OCX to do this???
Thanx.
Im only a beginner! So plz be willing to help me!
A good site 4 vb source code: www.a1vbcode.com
cya ;-)
-
March 19th, 2003, 11:58 PM
#3
ALSO2
Is there a way to set a default directory??
Say, where the app was installed??(like; app.path & ("\saved"))
Thanx again.
Im only a beginner! So plz be willing to help me!
A good site 4 vb source code: www.a1vbcode.com
cya ;-)
-
March 20th, 2003, 12:12 AM
#4
There is no need to COMDLG32.OCX for this..
ur code is fine and to add multiple times i hope u can loop thru the required no of times the PRINT Statment in ur code.
U Can set the default directory in a roundabout way as follows
Dim strFileName As String
strFileName = App.Path &
"<predefined FolderName>\<predefined FileName>"
Open strFileName For Append As #1
-
March 20th, 2003, 12:17 AM
#5
Thanks but....
but what i want is for a dialog box to come up and ask you where to save and the filename, etc.
SO they can save more than one file at a time.
Like when you would save a document in word. I have seen them b4 in vb projects.
Thanx anyway.
Im only a beginner! So plz be willing to help me!
A good site 4 vb source code: www.a1vbcode.com
cya ;-)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|