Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AERROR() question
Message
De
11/06/2002 10:08:09
Irv Adams
MSC Managed Care, Inc.
Floride, États-Unis
 
 
À
11/06/2002 07:31:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00666850
Message ID:
00666916
Vues:
22
Petros:

Perhaps you could use the ON ERROR trap early in your program and then call a Procedure which would base a message on the actual Error number returned from the COM using a Case Statement or something similar. The Aerror() cannot call another routine...

HTH,

-Irv.

--------------


>Hello all,
>
>How can remove the latest error from the AERROR() function ?
>
>
>What I actually try to do is the following :
>
>In a COM Server method I Have in the Error method the following code :
>
>
>
>******** Error Method on the server
>
>LPARAMETERS nError, cMethod, nLine
>Local lcRetVal
>lcRetVal = ALLTRIM(STR(nError)) + ": " + MESSAGE() + ;
> " on Line " + ALLTRIM(STR(nLine))
>COMRETURNERROR(cMethod, lcRetVal)
>
>
>******** on the client
>
>OX=CREATEOBJECT('MYSERVER.SERVER')
>ON ERROR lerror = .T.
>
>OX.TESR
>X=AERROR(my_array)
>
>IF X>0
> MESSAGEBOX('CALL ADMIN')
> MESSAGEBOX('' + my_array(1,2), 'CALL ADMIN')
>endif
>
>ON ERROR
>
>
>The problem is that the AERROR always have the latest error and cannot be refreshed unless I exit VFP
>
>
>The is any way to catch the OLE errors and show my own messages ?
>
>
>Thanks in advance
>Petros
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform