Menu

#1104 MessageBox clears the error flag without mentioned of behavior in documentation.

2.0 Series
closed-invalid
nobody
None
5
2016-12-26
2014-10-02
No

Documentation does not warn that the errors flag will be unset when a MessageBox is used. Not sure if this is intended behavior or not. If it is, this absolutely needs a big bold warning in docs that it will unset the errors flag to discourage usage during debugging (or at least have the cognizance to restore the error state).

I found this while debugging a macro that leaves the error flag set when a condition isn't met. Nobody likes heisenbugs.

Simple to reproduce in version 2.46:

SetErrors
IfErrors 0 +2
    MessageBox MB_OK "This should show (error)"
IfErrors +2 0
    MessageBox MB_OK "This should not show (error should still be present)"

Discussion

  • Anders

    Anders - 2014-10-05

    From the documentation for IfErrors: "Checks and clears the error flag..."

     
  • Anders

    Anders - 2016-12-26
    • status: open --> closed-invalid
     

Log in to post a comment.

Monday.com Logo