AND's and OR's in MSG validate pattern? (AREV Specific)
At 29 MAR 2002 01:58:03PM Michael Slack wrote:
I'm working with AREV 3.12 and I wanted to use multiple validation patterns in a MSG (val_pattern, field 15, see page 370 in R/Basic manual). I've used single validation patterns in MSG's before but this time I wanted to define several but couldn't find a combination that would seem to work. I wanted to mimic something like the validation pattern in a dictionary item with the implied OR's by having things on different lines (I assumed value mark delimited) or using AND's by having things on the same line and linked by "_" or "+". As I said I couldn't find anything that would work. I did some looking thru this discussion area and other places but no go. Can anyone point me in the right direction? Or is it even possible to define multiple validation patterns to a MSG?
Thanks,
Michael Slack
At 30 MAR 2002 08:19AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Why can't you simply run validation code after the MSG call? Usually there are a range of user responses to be handled differently. e.g.
DECLARE SUBROUTINE MSG REPLY=N" MSG("Are you really sure? (Y/N)",'RC',REPLY,REPLY) IF REPLY=" THEN RETURN IF REPLY=Y" OR REPLY=N" THEN CALL DO_EXPECTED_STUFF() RETURN END MSG("Very funny. ":REPLY:", albeit witty, is unacceptable.",'','','')World Leaders in all things RevSoft
At 30 MAR 2002 10:35AM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:
Msg uses the standard in.pattern checking used elsewhere in the system so it is possible to do this. As we have pointed out, checking post message provides ultimate flexibility however if you do want a quick and dirty you can store multiple validations in field 15 of the message definition.
"BLUE"
(DE)+(10000,12000)
where
is @Tm - will validate the entry to be "BLUE" or a date between 18th May 1995 and 7th Nov 2000.
If the user enters an erroneous input the error message here leaves a little to be desired hence our earlier suggestion.
World Leaders in all things RevSoft
At 01 APR 2002 02:09PM Michael Slack wrote:
Thank you. I normally do check the user's inputs from a message. Which in some cases can require a bit of code. The reason for my original question is that I came across a situation where the system would do the same thing fore me without my generation (or coping) of code to handle the response. As I learn more about how to properly use the MSG command, I'm hoping that it will help me to use the built-in features better. Also, if I can do that without writing code to what the system will do for me already, then I can be more productive. Plus I'm tooking towards being able to use the RESP_CODE (Field 16) of the message to present the users with a slightly better error message (if I'm reading the manual correctly). Plus I see other features that I can possibly use in the future that will help me and my users and anyone else how has to read my code. Why re-invent the wheel if I don't have to. I'm looking to use the system features to their fullest when appropriate.
Thank you,
Michael Slack
At 01 APR 2002 02:24PM Michael Slack wrote:
Thank you. I don't think I would have thought of a Text Mark as the "OR" seperator. This is what I was looking for. I realize that the standard error messages can leave something to be desired but the reason for my question was that I came across a situation where it was better to use the built-in functions instead of writing the code myself. I like the feature of the message looping if the input isn't correct. That is one less thing I've got to code and it makes the code smaller and hopefully easier to read and change latter.
Thank You,
Michael Slack