Sign in to follow this  
Followers 0
bornsan

conditional statement

2 posts in this topic

Hello guyz! I'm a newbie, i used this script to automatically login to a site, it will open the firefox and execute the script the problem is i want to return an error like when the user accidentally close the firefox or when there is no connection or the firefox is not installed. any suggestions, comments is very much appreciated...thanks! ;)

Case $CONNECT
    GUISetState (@SW_DISABLE)
    $uname = GUICtrlRead ($USERNAME)
    $upass = GUICtrlRead ($PASSWORD)
    $site = GUICtrlRead ($Combo1)
    MsgBox(0, "VSAL v1.0", "Please wait until the webpage is fully loaded")

       _FFStart($site)
    If _FFConnect() Then
       _FF_AutoLogin($uname , $upass, $site)
       MsgBox(0, "VSAL v1.0", "Webpage loaded successfully") 
       GUISetState (@SW_ENABLE)

           Else if there is no connection or the firefox is accidentally closed or not installed Then
       MsgBox(0, "ERROR", "Webpage did not load successfully, please try again")
       GUISetState (@SW_ENABLE)
       EndIf

Share this post


Link to post
Share on other sites



Most functions have a @error response.

find

Failure: Returns 0 and sets @ERROR

also check SetError in helpfile.

if @Error then msgbox(0,'Error','You got a error')
endif

[Cheeky]Comment[/Cheeky]

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