Jump to content

invalid file handle error!


Recommended Posts

line 0(my dir/my prog.exe)

$file = fileopen.. yadda yadda yadda

error: invalid file handle

IM SICK OF TYPING THE DAMN ERROR.. this is not exact.

heres the deal/

the damn script worked fine.

i added another part that would print a variable into a text file.

i changed the name of the variables and everything.. that didnt help.

\

also the error says line 0 but its in the middle of the script.. and everything runs fine till that line is called. i know where it is in the script... but still.. line 0 is not where it is.

why the hell do you get errors like this.. how do you fix them.

everything looks fine to me, and the script ran fine until i added some other stuff but that should not effect it.

the $file variable i have named to other things.. tried a bunch of stuff. just to make sure it wasnt conflicting with another variable with the same name.

i dont know what the deal is.. and im quite agitated.

so.. what do i do now....?

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

actually, the script is quite large,

and i just asked why i would get a file handle error.. is that something wrong with the name?

i want to learn why i got this error, or why one might occur.

the command seems fine, i pasted it out of the help file.

i can clip part of the code and put it in here... but i dont see what good it will do.

its perfectly written

$fileparse = FileOpen(@DesktopDir & "/steal/config/parse.txt", 0)



If $fileparse = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf


while 1
    $lineparse = FileReadLine($fileparse)

the command its getting stuck on is.. you guessed it.

$lineparse = FileReadLine($fileparse)

i need to calm down, but i just want to know what exactly a file handle error IS!

then i can maybe do this myself....

file handle.. i figured was the files name. but that seems fine...

directory is fine.

so what gives?

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

  • Developers

actually, the script is quite large,

and i just asked why i would get a file handle error.. is that something wrong with the name?

i want to learn why i got this error, or why one might occur.

the command seems fine, i pasted it out of the help file.

i can clip part of the code and put it in here... but i dont see what good it will do.

its perfectly written

$fileparse = FileOpen(@DesktopDir & "/steal/config/parse.txt", 0)
If $fileparse = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
while 1
    $lineparse = FileReadLine($fileparse)

the command its getting stuck on is.. you guessed it.

    $lineparse = FileReadLine($fileparse)

i need to calm down, but i just want to know what exactly a file handle error IS!

then i can maybe do this myself....

file handle.. i figured was the files name. but that seems fine...

directory is fine.

so what gives?

<{POST_SNAPBACK}>

Filehandle is a number which represents the "Handle to the file" returned by the FileOpen command and used by FileRead(), FileReadLine() and FileClose() commands.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

thanks jdeb. now....

i swear to god.. i checked more than 3 times

im opening the file in read mode instead of write mode.

thanks!

i wish the error (all errors really) could be more specific.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

  • Developers

i wish the error (all errors really)  could be more specific.

<{POST_SNAPBACK}>

Nah, would make the autoit3 program much to big if you have to test for all possible scripter errors and put in longer error messages like:

"No stupid, you opened the file in read-only mode in stead of write at line 123 and are trying to write to it in line 234."

:(

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...