Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Going out of the unfinished program
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00473740
Message ID:
00473809
Views:
17
>>>Hi everybody,
>>>
>>>We have this situations. On the record level we cal a function, which has the same name, as a table+"Tr" at the end. Say, PropMstrTr.
>>>
>>>The syntax of this function is like this:
>>>
>>>lparameters pcField
>>>=Test1(parms)
>>>=Test2(parms)
>>>=Test3(parms)
>>>=Test4(parms)
>>>etc.
>>>return .t.
>>>
>>>If Test1 fails, it invokes another function (general), which logs info into LogTable, etc.
>>>
>>>Validation could be run in batch mode, or can run interactively using a form.
>>>The problem is, after Test1 fails, we want to return to a Form and don't run other tests. Do you know, how can we make it happen?
>>>
>>>My original suggestion was to use this syntax:
>>>Test1() and Test2() and etc. , but as I understand, in batch mode we want to perform all tests and log all errors. So, this idea would not work.
>>>
>>>The program itself should not care about modes, etc., IOW, code in the program should remain.
>>>
>>>Do you have ideas to help us?
>>>
>>>TIA.
>>
>>Nadya,
>>
>>I don't quite understand your question, but have you looked at the RETURN TO ... command? This could be what you're after. It may be that my ErrHandler has some application to your problem, but further clarification would be needed.
>>
>>Mike
>
>Hi Mike,
>
>I thought about Return to Master, etc., but I'm not sure, how this would be applied in this situation. BTW, once again it's not the problem of my app, it's NSL problem, but as usual, I'm just trying to solve this problem anyway.
>
>Ok, now I'll try one more time to describe it (see also my reply to Andrew):
>
>Suppose, we have a Form. This Form has a button, called Validate. This button would execute some code, like this:
>
>select Table
>scan
>scatter memvar memo
>gather memvar memo
>
>Fields have validation rules. Table also has a Table Rule, like, PropMstrTr with 8 calls to different functions. In the body of each test function there is a call to another function, which is general purpose function (it performs logging, etc.) This is at least how I understand the problem without actually seeing this form and checking the code in details. Now, if Test1() fails and invokes the general function, called EvalCode(), we want to log this error and return to the form itself. See the problem now?
>
>Thanks in advance for your further explanations.

OK, so why can't your evalcode() routine execute the RETURN TO back to the form, which requires no change to the test programs. You could put the logic in evalcode() to decide whether to use a normal return or a non-local return.

Mike
Montage

"Free at last..."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform