Sign in to follow this  
Followers 0
meekaah

Check if file exists

3 posts in this topic

#1 ·  Posted (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 by meekaah

Share this post


Link to post
Share on other sites



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()?

:)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

mmm.. FileExists()?

;)

DAMN how did i NOT see that in the help files LOL

:) thanks alot

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