Sign in to follow this  
Followers 0
aGorilla

SetError() usage.

3 posts in this topic

From reading the docs, and searching for examples, I expected the following code to...

1. Set @Error to 1

2. Set @Extended to 2

3. Return False

msgbox(262144, '', Dummy())
msgbox(262144, '', @Error)
msgbox(262144, '', @Extended)

Func Dummy()
  Return SetError(1, 2, False)
EndFunc

It returns false, but it's not setting @Error or @Extended. Any suggestions?

I'm also wondering if there's some 'standard' for using SetError, but a quick scan of the forums implies that there is not. If there is a standard, I'd love to know.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This will do the trick...

$Info = Dummy()
$Info1 = @error
$Info2 = @extended
MsgBox(262144, '', "Return = " & $Info & @CRLF & "Error = " & $Info1 & @CRLF & "Extended = " & $Info2)

Func Dummy()
    Return SetError(1, 2, False)
EndFunc   ;==>Dummy

the message boxes have their own error reporting/returns

8)

Edited by Valuater

NEWHeader1.png

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