Jump to content
Sign in to follow this  
meekaah

Check if file exists

Recommended Posts

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

:)

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  

×
×
  • Create New...