|
-
November 21st, 1999, 05:40 PM
#1
How so i save to a file?
Hey i need some help, i am making this text simple program and, you no the part where the user selects File|Save as, wekk i need the code for the saving. Please help, thanks
PanasonicSubz
-
November 21st, 1999, 06:07 PM
#2
Re: How so i save to a file?
Right - first you need to open a file for writing:
fn=FreeFile
Open Path & FileName for input as #fn
This code opens a file so that you can write data into it, creating it if it doesn't already exist. And then you put the contents of the text box into the file. Assuming your textbox is called Text1:
print #fn, Text1.Text
Then you close the file:
close #fn
And that's all there is to it.
One final word - Path and FileName above are strings. They contain the location you are saving to. Path must end with a "\" or FileName must start with one, but not both. Path and FileName can both be retrieved by using the Common Dialog Save "Path" and "FileName" properties.
Hope this helps.
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
|