Fossil Rock Posted December 25, 2005 Posted December 25, 2005 Is this normal? Error code: -1 for line # (343) : FileClose($Var1) Agreement is not necessary - thinking for one's self is!
Moderators SmOke_N Posted December 25, 2005 Moderators Posted December 25, 2005 That doesn't sound like a return value for FileClose() but maybe the error for the wrong File Handle for FileOpen(). $Var1 = FileOpen() FileClose($Var1) << contains the File Handle for FileOpen... That's the only thing I can think of that would throw a -1 error. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
LxP Posted December 26, 2005 Posted December 26, 2005 FileClose() can't be used with filenames -- you must pass it a handle generated by FileOpen().Here's an example use of FileOpen() and FileClose():Local $Handle = FileOpen('C:\File.txt') If $Handle <> -1 Then ; Perform file operations Local $Data = FileReadLine($Handle) ; ··· FileClose($Handle) EndIf
Moderators SmOke_N Posted December 26, 2005 Moderators Posted December 26, 2005 FileClose() can't be used with filenames -- you must pass it a handle generated by FileOpen(). Here's an example use of FileOpen() and FileClose(): Local $Handle = FileOpen('C:\File.txt') If $Handle <> -1 Then ; Perform file operations Local $Data = FileReadLine($Handle) ; ··· FileClose($Handle) EndIf Hmmm, that's what I had tried to say, but much more elequently put! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now