I am trying to catch an error that might occur if the user of the program does not have Macrobond installed. I have modelled the code below on the example given on page 133 in the EViews 7 command reference:
Code: Select all
!max_before=@MaxErrs
SetMaxErrs !max_before+1
!err_before=@ErrorCount
DbOpen(type=macrobond) macrobond as mb
!err_after=@ErrorCount
If !err_after>!err_before Then
@UiPrompt("Could not open the Macrobond database. The program requires Macrobond to be installed.")
Stop
EndIf
SetErrCount !err_before
SetMaxErrs !max_before
But the first line generates an error message: '@MAXERRS is an illegal or reserved name in "!MAX_BEFORE=@MAXERRS" in MyFile.prg'. What am I doing wrong?