autocomplex Posted August 24, 2007 Posted August 24, 2007 I am trying to check if the ReadMe file exists, and if it does, to open it. Else display that it could not be found. This is what I have tried using the Help File, but it doesn't seems to do either of the Open or say it doesn't exist. What am i Do wrong? Case $msg = $MenuInstructions FileExists("ReadMe.txt") If NOT @Error Then FileOpen("ReadMe.txt",0) Else SplashTextOn("Error:","File Not Found! You Must have deleted it!",200,300) EndIf Any help is greatly appreciated. =) Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum!
Developers Jos Posted August 24, 2007 Developers Posted August 24, 2007 If FileExists("ReadMe.txt") Then FileOpen("ReadMe.txt", 0) Else SplashTextOn("Error:", "File Not Found! You Must have deleted it!", 200, 300) EndIf 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.
Misha Posted August 24, 2007 Posted August 24, 2007 Problem was that @error was set earlier in the script, or what?
Developers Jos Posted August 24, 2007 Developers Posted August 24, 2007 Problem was that @error was set earlier in the script, or what?FileExits() doesn't set the @error macro but just returns 1 if the file exists or 0 when not ... 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.
Tiger Posted August 24, 2007 Posted August 24, 2007 or this: Case $msg = $MenuInstructions $var = FileExists("ReadMe.txt") If $var = 1 Then FileOpen("ReadMe.txt",0) Else SplashTextOn("Error:","File Not Found! You Must have deleted it!",200,300) EndIf My UDFs:- _RegEnumKey
autocomplex Posted August 24, 2007 Author Posted August 24, 2007 still does nothing, it doesn't open the file at all ... nor does it show the splash text Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum!
autocomplex Posted August 24, 2007 Author Posted August 24, 2007 any clue to why it does this? Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum!
Tiger Posted August 24, 2007 Posted August 24, 2007 or this: #include <File.au3> Case $msg = $MenuInstructions $var = FileExists("ReadMe.txt") If $var = 1 Then FileOpen("ReadMe.txt",0) Else _FileCreate("ReadMe.txt") EndIf My UDFs:- _RegEnumKey
bogQ Posted August 24, 2007 Posted August 24, 2007 (edited) still does nothing, it doesn't open the file at all ... nor does it show the splash text FileOpen -------------------------------------------------------------------------------- Opens a text file for reading or writing. things like array .... $file = FileOpen("test.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileClose($file) ; Another sample which automatically creates the directory structure $file = FileOpen("test.txt", 10); which is similar to 2 + 8 (erase + create dir) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileClose($file) I think that this is what you need... ShellExecuteWait("ReadMe.txt") ShellExecuteWait -------------------------------------------------------------------------------- Runs an external program using the ShellExecute API and pauses script execution until it finishes. ...instead of FileOpen command or maby im wrong? Edited August 24, 2007 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
autocomplex Posted August 24, 2007 Author Posted August 24, 2007 WORKS !!! Thanks! Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum!
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