Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to generate an error in calling program
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00699719
Message ID:
00699723
Vues:
16
>Hi,
>
>I need to check return values of many API function calls within class. In order to simplify this task I have the following idea: assign a return value to a property of a class and test a value in Assign method for that property.
>
>Define Class test as Custom
>	Protected RetVal
>	Protected Procedure RetVal_Assign(tnRetVal)
>		If tnRetVal != 0
>			Error "Error #" + Trans(tnRetVal)
>		EndIf
>	EndProc
>	Procedure SomeMethod()
>		This.RetVal = SomeAPIFunction()
>	EndProc
>EndDefine
>
>However this code will generate an error within line with Error statement, but I want to generate an error within line where API function is called. Any ideas?
>
>TIA,
>Alexander

Alexander, I'm not sure :

I think your ERROR command it wrong by itself, thouhg it souldn't "error".
But anyway, shouldn't it be ERROR nErrorNumber,"cErrorArgument" ?

Possibly this helps ...

Peter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform