Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I have both TRY ENDTRY and the debugger?
Message
De
01/03/2008 13:21:21
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Can I have both TRY ENDTRY and the debugger?
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01297974
Message ID:
01297974
Vues:
74
Hi,

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?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform