Sign in to follow this  
Followers 0
Joon

error handling

18 posts in this topic

Is there way to surpress any error message from AutoIt? Have it just quit without and dialog.

Such as these kind of errors.

Dim $array[2]
$array[3] = 2

Share this post


Link to post
Share on other sites



Is there way to surpress any error message from AutoIt? Have it just quit without and dialog.

Such as these kind of errors.

Dim $array[2]
$array[3] = 2
Code it correctly?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Just set the script to restart...

If Not $CMDLINE[0] Then
    Run(@ScriptFullPath & ' /ErrorStdOut')
    Exit
EndIf

Crash'n'Burn silently.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Just set the script to restart...

If Not $CMDLINE[0] Then
    Run(@ScriptFullPath & ' /ErrorStdOut')
    Exit
EndIf

Crash'n'Burn silently.

I was being funny... I hope you took it as that, I searched all over... and couldn't find anything but MHz's COM error handling, and low and behold, look who posts a solution :).

Edit:

Now I'm wondering if this was a joke :mellow:? No matter what the situation, an error or not... Mine bites the dust. Have a working example MHz?

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I was being funny... I hope you took it as that, I searched all over... and couldn't find anything but MHz's COM error handling, and low and behold, look who posts a solution :).

Edit:

Now I'm wondering if this was a joke :mellow:? No matter what the situation, an error or not... Mine bites the dust. Have a working example MHz?

Did you compile it and run the EXE ?

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

#6 ·  Posted (edited)

Did you compile it and run the EXE ?

LOL...yeah... Went APE **** :) Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

LOL...yeah... Went APE **** :)

thats....

SHOW ME SOME SCRIPT

8)

you changed it???

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

thats....

SHOW ME SOME SCRIPT

8)

you changed it???

Yeah... cuz it looked like I was demanding Jdeb to show me a script... and I was trying to be funny... Soooo I just edited it.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Hmm, time for another tasty Cocktail to wet the taste. Oh, SmOke_N, is that some kinda loop ya saying. It needs another edit to make me loop again. :)

Share this post


Link to post
Share on other sites

Try this version:

If Not $CMDLINE[0] Then
    Run(@ScriptFullPath & ' /ErrorStdOut /Dummy')
    Exit
EndIf

Dim $array[2]
$array[3] = 2

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

Try this version:

If Not $CMDLINE[0] Then
    Run(@ScriptFullPath & ' /ErrorStdOut /Dummy')
    Exit
EndIf

Dim $array[2]
$array[3] = 2
I didn't know if I should try that version!!! ... /Dummy felt like it was pointed at me :)

Yes this one works perfectly!!


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

... /Dummy felt like it was pointed at me :)

Sort of .... nah not really ....

Just expected you to solve this yourself ... :mellow:


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

#13 ·  Posted (edited)

Hmm, time for another tasty Cocktail to wet the taste. Oh, SmOke_N, is that some kinda loop ya saying. It needs another edit to make me loop again. :)

This is what I ran ... I ran it both ways... With an error and without
If Not $CMDLINE[0] Then
    Run(@ScriptFullPath & ' /ErrorStdOut')
    Exit
EndIf

HotKeySet('{END}', 'TestSilentExitOnly')
HotKeySet('{PAUSE}', 'TestSilentExitRestart')
HotKeySet('ESC', 'EXITNOW')

While 1
    Sleep(1000)
WEnd

Func TestSilentExitOnly()
    Local $array[3]
    $array[2] = 2
    MsgBox(0, 'Testing 1', $array[2])
EndFunc

Func TestSilentExitRestart()

    Local $array[3]
    $array[2] = 2
    MsgBox(0, 'Testing 2', $array[2])
EndFunc

Func EXITNOW()
    Exit
EndFunc

Then With Jdebs /Dummy it works:

If Not $CMDLINE[0] Then
    Run(@ScriptFullPath & ' /ErrorStdOut /Blah')
    Exit
EndIf

HotKeySet('{END}', 'TestSilentExitOnly')
HotKeySet('{PAUSE}', 'TestSilentExitRestart')
HotKeySet('ESC', 'EXITNOW')

While 1
    Sleep(1000)
WEnd

Func TestSilentExitOnly()
    Local $array[3]
    $array[2] = 2
    MsgBox(0, 'Testing 1', $array[2])
EndFunc

Func TestSilentExitRestart()

    Local $array[3]
    $array[2] = 2
    MsgBox(0, 'Testing 2', $array[2])
EndFunc

Func EXITNOW()
    Exit
EndFunc
Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Goes to show, if you want no errors silently, then you need to toss some errors in, to make it work. Good work, JdeB.

Edit:

Sorry, my example did go stupid with executing...

Edited by MHz

Share this post


Link to post
Share on other sites

Sort of .... nah not really ....

Just expected you to solve this yourself ... :mellow:

I deserve that I guess :):)

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

This is what I ran ... I ran it both ways... With an error and without

If Not $CMDLINE[0] Then
    Run(@ScriptFullPath & ' /ErrorStdOut')
    Exit
EndIf

HotKeySet('{END}', 'TestSilentExitOnly')
HotKeySet('{PAUSE}', 'TestSilentExitRestart')
HotKeySet('ESC', 'EXITNOW')

While 1
    Sleep(1000)
WEnd

Func TestSilentExitOnly()
    Local $array[3]
    $array[2] = 2
    MsgBox(0, 'Testing 1', $array[2])
EndFunc

Func TestSilentExitRestart()

    Local $array[3]
    $array[2] = 2
    MsgBox(0, 'Testing 2', $array[2])
EndFunc

Func EXITNOW()
    Exit
EndFunc

Then With Jdebs /Dummy it works:

If Not $CMDLINE[0] Then
    Run(@ScriptFullPath & ' /ErrorStdOut /Blah')
    Exit
EndIf

HotKeySet('{END}', 'TestSilentExitOnly')
HotKeySet('{PAUSE}', 'TestSilentExitRestart')
HotKeySet('ESC', 'EXITNOW')

While 1
    Sleep(1000)
WEnd

Func TestSilentExitOnly()
    Local $array[3]
    $array[2] = 2
    MsgBox(0, 'Testing 1', $array[2])
EndFunc

Func TestSilentExitRestart()

    Local $array[3]
    $array[2] = 2
    MsgBox(0, 'Testing 2', $array[2])
EndFunc

Func EXITNOW()
    Exit
EndFunc
I'm sure what I am doing wrong but there was no error in your code. If throw in error, it still display error message.

The problem I am facing is that my script runs from the network share. When network connect is lost users will get error message on next step on the script (attached). This is what I want to surpress.

Posted Image

Note: they still have connection to the database just not to the fileshare.

Edited by Joon

Share this post


Link to post
Share on other sites

I'm sure what I am doing wrong but there was no error in your code. If throw in error, it still display error message.

The problem I am facing is that my script runs from the network share. When network connect is lost users will get error message on next step on the script (attached). This is what I want to surpress.

Posted Image

Note: they still have connection to the database just not to the fileshare.

For com errors you need to use the COM error handler ...

is explained in the Helpfile ...

:)


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

For com errors you need to use the COM error handler ...

is explained in the Helpfile ...

:)

That will do. All other function seems to stay in memory. Thanks.

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