7 Replies Latest reply on Dec 15, 2010 10:46 AM by raybaudi

    Text Align Function

    etripoli

      Title

      Text Align Function

      Post

      I have a feeling I know the answer to this question, but I'm hoping I'm wrong:

      Is there a function for Text Align actions, such as Center, Left, Right, etc?  I could see why FM wouldn't implement something like this - people trying to right-justify & center at the same time, but it seems sooo easy to add.  Is using a web-viewer the only option?

        • 1. Re: Text Align Function
          philmodjunk

          No such functions are listed in FileMaker help and a check of Text Formatting functions does not list any alternatives.

          Is using a web-viewer the only option?

          Maybe. What are you trying to do with these functions?

          • 2. Re: Text Align Function
            etripoli

            Print labels.  Except I want to give the user the ability to choose the text formating options based on global fields, because the formatting options need to be translated into commands the printer can understand.

            More depth:  the database I'm working on is used to print labels to a Zebra label printer.  The OS print driver does an okay job, but there are many more functions and features of the printer available when using it's internal language, ZPL.  By taking the fields from the database record and combining them with ZPL-specific commands, then exporting the result as a file, and sending that file to the printer, it can be instructed to print barcodes, serial numbers, stored graphics, symbols, etc.  In order for the user to make choices on how to format 'ad hoc' labels, have a WYSIWYG representation, and have those choices applied in ZPL, the best option I can come up with is global fields with formatting options.  Except there's no function for Text Align!  But a web viewer with some clever HTML inserted might do the trick...

            • 3. Re: Text Align Function
              raybaudi

              "Except there's no function for Text Align! "

              ... but there is a trick !

              All you need to have is 4 global text fields, each containing a lone space, formatted with Left, Right, Center or Full alignment.

              Then, to format whichever field, you just use something like:

              Substitute ( Trim ( gCenter & Substitute ( YourField ; ¶ ; "§§§" ) ) ; "§§§" ; ¶ )

              where gCenter is a field with a space, formatted to be aligned to center.

              • 5. Re: Text Align Function
                etripoli

                Now that's tricky!

                Just need to find a way to do this based on arbitrary choices made by the user.  I wonder if copy & paste would give the same result...

                • 6. Re: Text Align Function
                  philmodjunk

                  Why not use Raybaudi's trick with a Set Field step? (That's better than copy/paste.)

                  • 7. Re: Text Align Function
                    raybaudi

                    What do you mean with "arbitrary choices made by the user" ?

                    Give us some examples, please.