Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trigger message in dbc
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00146775
Message ID:
00147204
Views:
36
>Barbara,
>Unfortunately, my co-worker has already implanted all the verification inside the DBC and to undo would be a huge mess. There is an interactive process where the user actually creates the DBC on the fly through a number of forms and the validation is then thrown into a generate DBC process. An extremely complicated process, but it meets the users needs exactly and they are extremely satisfied. The remaining issue however is this validation box (ie message box) that the dbc generates.
>
>Sandy

How about instead of putting the message into the Message field of the dbc, you put a call to your own function into the rule with an or, this way the function is not called if the rule evals to true, but if it evals to false, your messagebox is called... sort of like this... lets say your rule is

value > 12

Ok, so change it to be...

value > 12 or mymessagebox('This is the message')

So, if value > 12 is true, then since there is an or foxpro has no need to eval the next expression so it doesn't it just returns a .t.

But, if value > 12 is false, the next expression has to be evaluated. So, mymessagebox is called. Make sure to return a .f. from mymessagebox, since you still want the rule to fail. The mymessagebox function (put it in stored procs) so it will work outside you applications could be like...

function mymessagebox(cMessage)

messagebox(cMessage)
return .f.

Should give you what you want... what do you think?

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform