March 13, 201510 yr I'd like to verify that a number of fields do not have any carriage returns (¶) in them. I already have an auto-enter calculation that I am adding to each field to prevent this from happening in the future. One solution is to create a secondary calc field that will return "1" if a carriage return is detected in 'FieldName': PatternCount(FieldName; "¶") > 0 If I search for "1" in this secondary field it works great (and I can fix individually or quickly via Replace Field Contents), but changing the calculation is tedious to do for a large number of fields. Is there instead a way I can enter Find Mode and enter something directly in the field I'm interested in fixing up? I've tried the following, but no records are found: ¶ "¶" ¶ Char(13) *"¶" dat pilcrow
March 13, 201510 yr This is not easy to enter manually*, but using a script you can do: Enter Find Mode [ ] Set Field [ Table::Textfield; ""¶"" ] Perform Find [ ] -- (*) You need to enter an actual carriage return in between the quotes, but in Find mode this would trigger the Perform Find action - so I believe the only way to do this manually is to paste it.
March 14, 201510 yr Author comment, you're a genius. Copying and pasting "¶" (where the ¶ is the invisible character, of course) does work manually, and your suggestion to use a script got me thinking… So, here's my script: Script Name: Find All Records with "¶" In Current Field # If [IsEmpty(Get(ActiveFieldName))] # Cursor not in any field Beep Show Custom Dialog [Get(ScriptName); "Please place your cursor in an active text field and try again."] Exit Script [] End If # # Attempt the find Enter Find Mode [] Set Field By Name [Get(ActiveFieldTableName) & "::" & Get(ActiveFieldName); ""¶""] Set Error Capture [On] Perform Find [] # Include this script in the menu, and now all I have to do is hit Command-6 (in my case) to immediately get what I want. Perfect!
March 14, 201510 yr A small nitpick and a caveat: This: Set Field By Name [ Get(ActiveFieldTableName) & "::" & Get(ActiveFieldName); "abc" ] does exactly the same thing as: Set Field [ "abc" ] Both rely on the cursor staying in the active field when you switch to Find mode. When will this assumption fail? When the active field is a global field. In such case, the first version will throw a "This action cannot be performed because the required table is missing." error, while the second one will fail silently.
Create an account or sign in to comment