Sergeant Ron Posted January 10, 2010 Posted January 10, 2010 I'm aware that you can set a character size within Filemaker, however on the layout there is no way that i am aware of to lock the size of the field, so that a user does not continue to type past the field limit size only to be later notified that they have exceeded the limit of the field characters. In the case of a solution that we use we have a narrative field. Often new users are unaware that they must stay within the size of the field on the layout and type past the limit because there is no way until they commit the record to advise them that they have reached the limit. The same would then apply for the script trigger which will not trigger until the field is committed. By allowing a lock of the size of the field on the layout users would not continue typing over the limit of the field on the layout.... Unless I am missing an existing feature (please tell me if I am) I think that this would be a welcomed modification. Thanks, Ron
TheTominator Posted January 10, 2010 Posted January 10, 2010 (edited) I think the current OnObjectKeystroke trigger allow you to program a maximum number of typed characters. Use this in addition to the OnObjectModify trigger to handle text pasted into the field. Edited January 10, 2010 by Guest
Sergeant Ron Posted January 10, 2010 Author Posted January 10, 2010 You're correct in this, however the issue that I have encountered is that when the users hit the carrige return (or the enter Key) to start a new paragraph, it will not count as characters entered from that point to the point of the cursor on the new line, thus pushing the txt farther along in the text field and defeating the purpose... Again, If you can suggest an alternative I would be very appreciative.
TheTominator Posted January 10, 2010 Posted January 10, 2010 when the users hit the carrige return (or the enter Key) to start a new paragraph, it will not count as characters entered from that point to the point of the cursor on the new line, If I understand you correctly, you want don't want to limit the number of characters in the field as much as limit the number of characters for each line in the field like a manual typewriter. A script like this triggered by OnObjectKeystroke works mostly like a typewriter limiting typing on each line to 70 chars. The script consists of only one line with a calculation in the Exit Script step. This only limits the last line being typed. If the user goes back and adds text to previous lines, it is not inhibited by this script. ExitScript[ Case( Code(Get ( TriggerKeystroke ) ) < 32 ; 1; /* Special codes are always permitted */ (PatternCount(MyTable::Description; "¶") > 0) and (Length(MyTable::Description) - Position ( MyTable::Description ; "¶" ; 1 ; PatternCount(MyTable::Description; "¶") ) ≥ 70); 0; (PatternCount(MyTable::Description; "¶") = 0) and (Length(MyTable::Description) ≥ 70); 0; 1 ) ]
Sergeant Ron Posted January 14, 2010 Author Posted January 14, 2010 I'll tinker with this... It looks like a nice script that may work for me and I thank you for the suggestion!
Recommended Posts
This topic is 5557 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