B-Man Posted February 28, 2002 Posted February 28, 2002 I have a file that I need to restrict the user to entering a certain set of characters. If they use a character outside of the set I need it to error. Is this possible in FileMaker? Thanks Brian
Peter Fenner Posted February 28, 2002 Posted February 28, 2002 Do you want to limit the possible entries into a specific field? If this is the situation, would a value list with your pre-determined allowable entries do the job? I'm not quite sure what you are trying to achieve - please explain more. Pete
B-Man Posted March 1, 2002 Author Posted March 1, 2002 Pete, I have an embossing machine that will stamp the names of people at the bottom of books. I only have a certain number of characters on a wheel of the embosser. I want to be able to limit the end user to only use the characters that are available. The user will type their name in a field and if they use a character outside the set I have allowed them I want it to alert them. I am doing other checks via a script right now and would like to add this to the script if possible. Thanks for any help, Brian
B-Man Posted March 1, 2002 Author Posted March 1, 2002 Pete, I have an embossing machine that will stamp the names of people at the bottom of books. I only have a certain number of characters on a wheel of the embosser. I want to be able to limit the end user to only use the characters that are available. The user will type their name in a field and if they use a character outside the set I have allowed them I want it to alert them. I am doing other checks via a script right now and would like to add this to the script if possible. Thanks for any help, Brian
danjacoby Posted March 1, 2002 Posted March 1, 2002 Haven't tested this: Perhaps you can validate by calculation, then use the "PatternCount" command. It's not a total solution, but it might provide a start.
Fitch Posted March 1, 2002 Posted March 1, 2002 Sounds like it should be simple, but it's a good one! Here what you need: 2 global fields, gCounter and gText. A new file, Characters, that has a text field, Character. Make a record in Characters for each legal character. In your original file, make a relation to Characters, gText::Character. Now make a script like this: Set Field (gCounter, Length(YourText)) Loop ..Exit Loop If (gCounter = 0) ..Set Field(gText, Middle(YourText, gCounter, 1)) ..If(IsValid(Characters::Character) ....Set Field (gCounter, gCounter - 1) ..Else ....Show Message ("Your strange characters frighten and confuse me. Please go away.") ....Exit Script ..End If End Loop Hey, that was fun!
B-Man Posted March 4, 2002 Author Posted March 4, 2002 Fitch, Works like a champ! I did have to add few more steps to bypass spaces. If (gtext=" ") SetField(gcounter, gcounter-1) SetField(gtext,Middle(gtext,gcounter,1) end if Thanks for the help Brian
Recommended Posts
This topic is 8357 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