Sign in to follow this  
Followers 0
87450kalle

FileOpenDialog error?!

4 posts in this topic

Hi,

When I open a file dialog and select any file then the script cant open the temp.txt file.

If I choose cancel in the file dialog the script will open the temp.txt file.

Why is that?

//Johan

$message = "Select new driver file"

$var2 = FileOpenDialog($message, "C:\Windows\system32\drivers\", "All (*.sys)")

$file = FileOpen("temp.txt", 0)

; Check if file opened for reading OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")

Exit

EndIf

Share this post


Link to post
Share on other sites



If I choose cancel in the file dialog the script will open the temp.txt file.

Why is that?

Adding If @error Then Exit after the FileOpenDialog() line will terminate the script if the user clicks Cancel.

Share this post


Link to post
Share on other sites

Why is that?

That's O.K. See help file of FileOpenDialog().

@WorkingDir is changed on successfull return.

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Thats it!! Finally, Thanks Kurt u made my day:-) and I found the help text in the Beta help file. (will be using that one instead...)

Thanks again /Johan

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  
Followers 0