See Also: Global Variables Used by Data Dictionaries
To provide a means for determining if an error has been generated, and for restoring the error indication to negative.
Boolean
Whenever a runtime error occurs in DataFlex, Err is set true. After occurrence of the first error, Err remains true until it is reset false by an explicit command.
If (Err) Begin
send Stop_Box "An Error was Encountered"
End
Move False to Err
If Err is true when the first line above is executed, it displays the "An Error was Encountered". The next line unconditionally resets Err false.
If (Err) Begin
Send DoUpdate
End
If Err is true when this line of code is executed, Procedure DoUpdate is executed. DoUpdate would typically have a "Move False to Err" line in it.
Never rely on the value of the Err indicator other than on the line immediately following the line of code that sets it. Many different commands and messages alter the value of Err. It is best to move the value of Err to a local variable if you need to use its value later in your code:
Boolean bErr
:
Send Request_Save of oCustomer_DD
Move (Err) to bErr
:
If (bErr) Begin
:
End