Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Going out of the unfinished program
Message
 
 
À
08/02/2001 11:07:32
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00473739
Message ID:
00474017
Vues:
23
>>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.
>
>An ingenious idea from YAG and folks at Flash, that I found in ComCodebook:
><pre>lReturnStatus=.f.
>do case
>   case not test(1)
>   case not test(2)
>   case not CallOfThirdFn()
>   ...
>   otherwise
>      lReturnStatus=.t.
>endcase
>return lReturnStatus
>I simply love this.

Hi Dragan,

The idea here to run all tests if we're in batch mode and run tests till first error if we're in interactive mode. Also the text of the Validation Table code program should remain the same as it is now, IOW:
=Test1()
=Test2()
etc.
return .t.

In the program, which called from Test1() in case it fails, we know, in which mode we're and this program should stop execution of the TableTr() program and return control to a form?

This is what I want. If I need to modify the original program, I know, how I would do it.

Anyway, thanks.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform