3 Replies Latest reply on Nov 26, 2008 8:27 AM by user8294

    Formatting spaces



      Formatting spaces


      I am currently using the "show custom dialogue" function to display a small sales report, which is fine but i would like to improve the way the data displays, the data is compiled within a variable as its not required to be kept after the report has been viewed


      Example - This is how it currently displays


      Origin                       Sales


      E-Shot - £31900.00

      Yellow Pages £19000.00


      Example - This is how I would like it to appear


      Origin                       Sales


      E-Shot                  £31900.00

      Yellow Page           £19000.00


      The Variable is compiled in a loop using this fuction;

      $StatText & $CurrentOrigin & " - " &  $TotalSales & ¶


      I could easily work out how many spaces are required using the length fuction, but i dont know how to insert them as a calculation, I also dont know if it possible to add tabs into text as this was another option


      Anny help would be greatly appreciated

        • 1. Re: Formatting spaces



          Thank you for your post.


          Here is one option for your calculation:


          Left ($StatText & $CurrentOrigin & "                   "; 20) & Right ("          £" & $TotalSales; 10) & "¶"


          That is, we put together the $StatText and $CurrentOrigin variables along with 20 spaces.  We use the Left function to use the first 20 characters.  Since spaces are added to the end, they are removed.  In all cases, you are left with a 20-character string.


          Now, the Sales is a number/currency field, so we want that right justified.  So, we use the opposite logic.  That is, we takes 10 spaces and a "£" and add that the $TotalSales.  We then use the Right function to take the 10 rightmost characters, so we will end up with a 10 character string that is always right-justified.  Does that make sense?


          Let me know if you need clarification for any of the above steps.



          FileMaker, Inc. 

          • 2. Re: Formatting spaces

            Hi fairprint


            if you are on a Win machine ( I don't know on a Mac ) copy this text and put it in the calculation for the custom message:


            "aaaaaaaa bbbbbbbbbbbb"
            & ¶ &
            "cccccccccc aaaa"


            Note that the space between words isn't a space but a TAB; you can type that char with Ctrl + TAB.

            On a Mac you may need to store the tab in a global field by copying and pasting.

            • 3. Re: Formatting spaces

              Thanks, a combination of both options worked


              Spaces by themself did not because of the spacing in custom dialogue boxes is not equal but tabs by themself would not work either because of the variation in length of $CurrentObject


              $StatText & Left ($CurrentOrigin  & "                                                                         " ; 50)& "  " & $TotalSales  & "¶"


              This calculation does contain the tabs as described by raybaudi even though they show as spaces on this post