They probably have tab stops specified and insert tab characters between the text instead of spaces. That will automatically adjust for the fact that different letters have different widths unless you use a rather ugly monospaced font for your text.
You use Char ( 9 ) to include tab characters in a concatenation and you can use the appearance tab on the inspector to set tab stops. I use this method from time to time when creating formatted text from a calculation like this or from an ExecuteSQL function call.
Assuming I read your question correctly.
You might also try this:
1. Use a monospace font.
2. Try things like right(" " & yourfield; lengthRequired - length(your field))
This is a good opportunity to learn recursion.
Define custom function (needs FMP Advanced):
Add_Blank ( num ) = " " & if ( num>0; Add_Blank( num-1 ))
I once looked up "recursion" and the entry read "see recursion". I left it there after a few runaways.
1 of 1 people found this helpful
You don't need recursion nor a loop to add spaces:
Say that you need to add "x" spaces:
Substitute ( 10^x - 1 ; 9 ; " " )
will return X spaces
but determining the correct number of spaces to add instead of using a tab and a tab stop could be problematic.