AnsweredAssumed Answered

Managing Text Formatting in multiple fields, stripping or modifying

Question asked by afterhours on Jul 15, 2013
Latest reply on Jul 16, 2013 by afterhours

Title

Managing Text Formatting in multiple fields, stripping or modifying

Post

      

     Crafting a MSDS solution.  When populating records by cut/paste from resources, the formating of the original is retained, rather than the desired formatting assigned to each of the fields.  There are 150+ fields involved at present.  For readability and consistency, I'd like to have a way to strip the formatting from the text fields on a per-record basis.

     One way to insure uniform formatting is to use the autocalc in the option portion of defining the text field, with a self-referenceing calc [TextFormatRemove ( field_A )], but there are times where some reformatting may be desired, or retaining some formatting.  My desired solution to keep things flexible is to craft a script that would reformat a record on command (not forced as the above calc'd option achieves).  And the coder in me wants to write a script that would loop through all of the presented fields in a layout.

      

     Is there a way to step through each field in a particular existing record to 'update' the format (remove any format that came in via cut/paste from another source)?   I've played around with some scripts, isolating the record of interest with the old

     show all records

     omit record

     show omitted

     trick to show only the one record.  I've written a few scripts to try and attempt a more elegant method than brute forcing each field of interest using the Replace Field Contents tool have failed.   Ideally, I'd love to craft a way to start at the first field (in Tab order) of a layout,

     set a page variable for that field's name using Set Variable [$FieldToFormat, Value Get (ActiveFieldName)]

     then remove the formatting for that field, and loop through the next tab order field and repeat.   Ultimately work my way through an entire data entry form to resolve all formatting snafus.   Thus far, I've been stuck since using even simple tools like:

     Set Field By Name [$FieldToFormat, TextFormatRemove (GetField ($FieldToFormat,))]

     doesn't work as I expected.   Formats remain.  Bummer.

     Any ideas of what I'm overlooking?

     Filemaker Pro Advanced 11, OSX 10.7.5

Outcomes