Jump to content
Sign in to follow this  
miketh2005

FileOpen or FileWriteLine is not working...

Recommended Posts

miketh2005

This is my code:

$file = FileOpen(@MyDocumentsDir & "sfp.ini", 1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWriteLine($file, "Line1")
FileWriteLine($file, "Line2" & @CRLF)
FileWriteLine($file, "Line3")

FileClose($file)

I went to My Documents and it's not showing up, although I get no error message.

Share this post


Link to post
Share on other sites
Richard Robertson

@MyDocuments, as well as other directory macros, do not contain a \ on the end. You have to add it yourself. "\sfp.ini"

The file you made was at "C:\Documents and Settings\[user]\My Documentssfp.ini". I assume you use XP because Vista would have popped up on UAC trying to do something like that.

Edited by Richard Robertson

Share this post


Link to post
Share on other sites
miketh2005

Oh, ok, thanks, guys >_

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×