scg198 Posted August 5, 2001 Posted August 5, 2001 I want to validate the input of a field and generate an error if it is incorrect. The field is to allow letters, numbers, hyphens, fullstops and underlines. So commas and the rest of the other punctuation is not allowed. Thanks Simon [ August 05, 2001: Message edited by: SimonG ]
LiveOak Posted August 6, 2001 Posted August 6, 2001 So you don't have to check every position for valid characters, it's probably easier to check for all invalid characters (yes, you have to list them ALL). There are no validations by type in FM. The calculation to use in the validation entry in define fields could look like: not ( Position(text, ",", 1, 1) or Position(text, "*", 1, 1) or Position(text, "@", 1, 1) or . . . <--- add as many as you need separated by "or" ) I can't think of an easier way at the moment. To validate valid characters, you would have to compare each character up to the max lenght of and entry to a string, one character at a time. -bd
Bruenor Posted August 7, 2001 Posted August 7, 2001 one possible solution that might be to define a field that would never be modified that would contain "abcdefghijklmnopqrstuvwxyz1234567890-_" and whatever a fullstop is. then make the validation to check if each character in the input field is a member of the field with all the valid options. You can use PatternCount(Big Field, Left(Right(your field),1),1)) And PatternCount(Big Field, Left(Right(your field),1),2)) And PatternCount(Big Field, Left(Right(your field),1),3)) And . . . with as many characters as the input may be. This may not be easier than LiveOak's method, depending on how big the field could be. ~Ati, Jedi Master
Recommended Posts
This topic is 8580 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now