meekaah Posted September 5, 2007 Share Posted September 5, 2007 (edited) Hi, id like to check when opening a gui, to check if a file exists (that was created previously) then use a _FileReadToArray($file,$array) so that i can fill up the inputboxes of the GUI like "GUICtrlSetData ( $input, $array[1])" i know how to read text to array and fill up the input boxes that's not the issue, but i dont know how to check if a file exists, and if not just use the default values for the input boxes thanks in advance I tried this: $verify = FileOpen(@TempDir & "\profil1.txt", 0) If $verify <> "-1" then _FileReadToArray($verify,$array) GUICtrlSetData ( $input, $array[1]) EndIf >The rest of the script... But i allways get GUICtrlSetData ( $input, $array[1]) GUICtrlSetData ( $input, $array^ ERROR Subscript used with non-Array variable. Edited September 5, 2007 by meekaah Link to comment Share on other sites More sharing options...
Developers Jos Posted September 5, 2007 Developers Share Posted September 5, 2007 Hi, id like to check when opening a gui, to check if a file exists (that was created previously) then use a _FileReadToArray($file,$array) so that i can fill up the inputboxes of the GUI like "GUICtrlSetData ( $input, $array[1])" i know how to read text to array and fill up the input boxes that's not the issue, but i dont know how to check if a file exists, and if not just use the default values for the input boxes thanks in advance -Mika mmm.. FileExists()? 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 More sharing options...
meekaah Posted September 5, 2007 Author Share Posted September 5, 2007 mmm.. FileExists()?DAMN how did i NOT see that in the help files LOL thanks alot Link to comment Share on other sites More sharing options...
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