Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
In VFP can i use On error goto Errorhandler like VB
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00790450
Message ID:
00790566
Views:
21
No problem.

You may add to your main program
SET DEFAULT TO [your application working directory here]
and then issue the SET PATH command, depending on your application directory structure have something like:
SET PATH TO PROGRAMS; REPORTS; LIBS; 
Of course you can specify the full path to each directory instead of relative path.


>I am really sorry could you please tell me how i can add the programs directory to my application path.
>
>All the programs work fine we have more than 50 programs in the programs folder. all work fine except this mapierror does'nt work.
>
>because may be when i open the outlook after opening the outlook if i decide to cancel it then it might be not recognizing the path
>ON ERROR DO "PROGRAMS\mapierror"
>
>Could you please tell me what will be the best way to add those 4 lines mapierror.prg

>Is there a way i can add those 4 lines in the button click event where i am calling the email function.
>
>*****************************
>aError(ErrorArray)
>IF ErrorArray(1,1) = 1429 && mapi error
> MapiError = ErrorArray(1,6)
>ELSE
> MESSAGEBOX("ERROR HAS OCCURED "+ MESSAGE())
>ENDIF
>RETURN
>******************************
>
>Thank you.

No, you cannot add them to Click event. The right place for them are the error subroutines/methods that fire when the error actually occurs. You cannot add the procedure to the method code. But you can place these error handling lines into your button Error() method. That might be the good place to it. If you run similar tasks from somewhere else, then it will be better to place the code to the procedure you define with ON ERROR command.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform