Sure, that's what WHEN clause is for
..
CATCH TO oErr WHEN oErr.Errorno = 1098
...
>
>Quite often, I write my procedure or method (especially one which does some processing) in the below format
>
>
>lResult = .T.
>TRY
> <some codes>
>
> If NOT <condition1>
> ERROR <cDesciptiopm of unfulfilled condition1> // which generate error 1098
> endif
>
> <some codes>
>
> If NOT <condition2>
> ERROR <cDesciptiopm of unfulfilled condition2>
> endif
> .
> .
> .
> <some codes>
>
> If NOT <condition N>
> ERROR <cDesciptiopm of unfulfilled condition N>
> endif
> .
> .
> .
>CATCH TO oErr
> MESSAGEBOX(oErr.Message)
> lResult = .F.
>ENDTRY
>RETURN lResult
>
>
>Even though I like to code in the above format... but I find it difficult to debug!
>The problem is, all errors are channel to the CATCH block, be it error type 1098 that I intentionally trigger with the ERROR command or syntax error due to my typo/coding mistakes within the TRY ... ENDTRY structure... I wish to have syntax error handled in the original way -- a standard error message prompt followed by the popup of debbuger
>
>I wonder if I could modify the CATCH block to get what I want
>
>
>TRY
> .
> .
> .
>CATCH TO oErr
> IF oErr.ERRORNO = 1098
> MESSAGEBOX(oErr.Message)
> lResult = .F.
> ELSE
> (Prompt error message like normal)
> (bring up the debbuger for the oErr)
> END
>ENTRY
>
>
>Is it possible to do the (Prompt error message like normal) and (bring up the debbuger for the oErr) as above?
>If so, could anyone teach me how to code them?
--sb--