Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help please [VB]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Hack-Addict
Master Cheater
Reputation: 0

Joined: 20 Nov 2007
Posts: 287

PostPosted: Wed Dec 12, 2007 9:49 pm    Post subject: Help please [VB] Reply with quote

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 =,/

_________________

Sciextron made the userbar up here, Rep him =D

[img]http://i145.photobucket.com/albums/r225/Michaell61/header.gif[/img] <---Visit theprocoders today!
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Dec 12, 2007 9:53 pm    Post subject: Re: Help please [VB] Reply with quote

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
View user's profile Send private message Visit poster's website
Hack-Addict
Master Cheater
Reputation: 0

Joined: 20 Nov 2007
Posts: 287

PostPosted: Wed Dec 12, 2007 10:13 pm    Post subject: Re: Help please [VB] Reply with quote

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

_________________

Sciextron made the userbar up here, Rep him =D

[img]http://i145.photobucket.com/albums/r225/Michaell61/header.gif[/img] <---Visit theprocoders today!
Back to top
View user's profile Send private message
Nesray
Cheater
Reputation: 0

Joined: 25 Nov 2006
Posts: 47

PostPosted: Thu Dec 13, 2007 5:59 am    Post subject: Re: Help please [VB] Reply with quote

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
View user's profile Send private message
Blader
I post too much
Reputation: 2

Joined: 19 Jan 2007
Posts: 2049

PostPosted: Thu Dec 13, 2007 6:18 am    Post subject: Reply with quote

Declare f as long, and give f a free file number
_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Dec 13, 2007 3:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites