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:
00473928
Views:
19
Andrew,

All your suggestions require to change the original programs Table1Tr(), Table2Tr(), etc. Our objective to make data validation logic independant on UI. We don't want to change the existing table validations programs. We want to change just one General purpose program EvalCode.

Anyway, thanks for trying to help.

>OK
>
>How about this:
>
>
proc EvalCode(ErrorCode, pcField)
>&& do the logging here
>return llBatchMode
>endproc
Cheers,
>
>Andrew
>
>>Andrew,
>>
>>I understood your suggestion well enough (BTW, I'm just gathering the info, since it's not my application and it would not me changing the code :)). Let's explain the problem:
>>
>>I have table validation rules, say, 10 different tables and 10 different functions. Each Table rule validation function has multiple calls to other table validation functions, IOW:
>>
>>Table1TR() function:
>>
>>lparameter pcField
>>=Test1(params)
>>=Test2(params)
>>=Test3(params)
>>return .t.
>>
>>Test function have this kind of code
>>
>>lparameters par1, par2, par3, pcField
>>if such and such error
>>  return EvalCode(ErrorCode, pcField)
>>endif
>>return .t.
>>
>>EvalCode() is the general purpose function, which does all necessary work. So, the termination code should belong to EvalCode function, not the TableTR()
>>
>>Now, let's see, how the process runs:
>>
>>Record attempts to save. It calls TableTr() function. TableTr() calls Test1(). Test1() fails and calls EvalCode(). Now if we're in interactive mode, we have to stop there and report the problem to the user. We don't want to perform Test2, etc. untill first problem would be resolved.
>>
>>So, the question is: could it be done by EvalCode() function without changing Table1Tr(), Table2Tr(), etc.?
>>
>>
>>
>>>Hi Nadya,
>>>
>>>You're going to have to change code somewhere aren't you, otherwise why would you be asking the question <g>
>>>
>>>I'm suggseting the !WEXISTS(< form name >) (note the negation operator that I left out of my reply previously) go in the program I proposed in my original reply (which is where I think you do have some degree of control over what goes on if I undersand you correctly)
>>>
>>>Cheers,
>>>
>>>Andrew
>>>
>>>>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.
>>>>
>>>[snip]
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform