Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Going out of the unfinished program
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00473740
Message ID:
00473804
Vues:
15
Hi Andrew,

It still would require code changes in validation functions, which I'm trying to avoid. But at least it's an idea to think of.

Thanks.

>Hi Nadya,
>
>instead of using the mode as a parameter, could you use something like
>
local llBatchMode
>llBatchMode = WEXISTS(< form name >)
>
>Andrew
>>Hi Andrew,
>>
>>Thanks for your reply, but you didn't read this message carefully :) The program doesn't know about in which mode it would be run at all. It's not "her" problem. It's the problem of the whole application. The idea here is not change the code of the program, but change the code of program, which is invoked by this function.
>>
>>IOW, this program calls another general program in each Test() function.
>>Test function code is like this:
>>If some conditions
>> EvalCode(ErrorCode,pcField)
>> return .f.
>>endif
>>return .t.
>>
>>EvalCode is the general program, which knows about modes, etc. EvalCode logs errors into LogFile. So, the question is:
>>
>>The First program (PropMstrTr) is running. It invokes the first Test1(). Test1 fails and the EvalCode is running now. I'd like to return to the form if I'm not in batch mode and don't continue execution of the PropMstrTr. I don't want to place additional logic into PropMstrTr, if, of course, it's not the only way to achieve my goal.
>>
>>See now, what I meant?
>>
>>Thanks again for your help.
>>
>>
>>>Hi Nadya,
>>>
>>>How about this (off the top of my head):
>>>
>>>
>>>lparameters pcField, plBatchMode
>>>local llSuccess
>>>llSuccess = .t.
>>>
>>>if llSuccess or plBatchMode
>>>  llSuccess = Test1(parms) and llSuccess
>>>endif
>>>
>>>if llSuccess or plBatchMode
>>>  llSuccess = Test2(parms) and llSuccess
>>>endif
>>>
>>>if llSuccess or plBatchMode
>>>  llSuccess = Test3(parms) and llSuccess
>>>endif
>>>
>>>if llSuccess or plBatchMode
>>>  llSuccess = Test4(parms) and llSuccess
>>>endif
>>>
>>>etc.
>>>return llSuccess
>>>
>>>
>>>>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.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform