| View previous topic :: View next topic |
| Author |
Message |
Hack-Addict Master Cheater
Reputation: 0
Joined: 20 Nov 2007 Posts: 287
|
Posted: Wed Dec 12, 2007 9:49 pm Post subject: Help please [VB] |
|
|
Ok, so how would i make it, so a txt file gets saved in the c:\ drive with the save code?
I tried this
| Code: | Open app.path & "C:\SavedFile.txt" for output as #1
Print #1 as, text1.text
Close #1
|
And it gives me an error, the only thing i can do is make it save the txt file wherever the program is =,/
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Wed Dec 12, 2007 9:53 pm Post subject: Re: Help please [VB] |
|
|
| Hack-Addict wrote: | Ok, so how would i make it, so a txt file gets saved in the c:\ drive with the save code?
I tried this
| Code: | Open app.path & "C:\SavedFile.txt" for output as #1
Print #1 as, text1.text
Close #1
|
And it gives me an error, the only thing i can do is make it save the txt file wherever the program is =,/ |
You are putting App.Path in your open statement which isn't needed if you want to save to the C drive.
This should do the trick:
| Code: | Dim f As Long
f = FreeFile
Open "C:\savefile.txt" For Output As #f
Print #f, "Heres a message."
Close #f |
_________________
- Retired. |
|
| Back to top |
|
 |
Hack-Addict Master Cheater
Reputation: 0
Joined: 20 Nov 2007 Posts: 287
|
Posted: Wed Dec 12, 2007 10:13 pm Post subject: Re: Help please [VB] |
|
|
| Wiccaan wrote: | | Hack-Addict wrote: | Ok, so how would i make it, so a txt file gets saved in the c:\ drive with the save code?
I tried this
| Code: | Open app.path & "C:\SavedFile.txt" for output as #1
Print #1 as, text1.text
Close #1
|
And it gives me an error, the only thing i can do is make it save the txt file wherever the program is =,/ |
You are putting App.Path in your open statement which isn't needed if you want to save to the C drive.
This should do the trick:
| Code: | Dim f As Long
f = FreeFile
Open "C:\savefile.txt" For Output As #f
Print #f, "Heres a message."
Close #f |
|
It dosent work, it gives me a error when it's not with the command button, and when it is, it dosent save the file T_T
Edit: Nvm, i accidently dident type in D in Dim o.o lol
_________________
|
|
| Back to top |
|
 |
Nesray Cheater
Reputation: 0
Joined: 25 Nov 2006 Posts: 47
|
Posted: Thu Dec 13, 2007 5:59 am Post subject: Re: Help please [VB] |
|
|
| Wiccaan wrote: | | Hack-Addict wrote: | Ok, so how would i make it, so a txt file gets saved in the c:\ drive with the save code?
I tried this
| Code: | Open app.path & "C:\SavedFile.txt" for output as #1
Print #1 as, text1.text
Close #1
|
And it gives me an error, the only thing i can do is make it save the txt file wherever the program is =,/ |
You are putting App.Path in your open statement which isn't needed if you want to save to the C drive.
This should do the trick:
| Code: | Dim f As Long
f = FreeFile
Open "C:\savefile.txt" For Output As #f
Print #f, "Heres a message."
Close #f |
|
What would | Code: | Dim f As Long
f = FreeFile | do?
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Thu Dec 13, 2007 6:18 am Post subject: |
|
|
Declare f as long, and give f a free file number
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Dec 13, 2007 3:26 pm Post subject: |
|
|
FreeFile is used to tell the system which open file you are sending the information or taking information from during your process. The number that FreeFile returns is an increment of the next available file number to the system. The number can be 1 to 511/512 I think it was.
_________________
- Retired. |
|
| Back to top |
|
 |
|