What you describe should not be happening. Sounds like there's a "trim all" function somewhere undoing the addition of more spaces between the fields.
orders::OrderKey &" " & orders::cOrderDate & " " & subjectdetails::Name
Should result in two spaces between the values of each field.
And Char ( 9 ) can be used to put a tab character between the instead of a space. (If this is for display on a layout, you can use the inspector's appearance tab to set tab stops for these tab characters.)
OK< further to my last ....
The calculation IS behaving correctly and the spaces are there. But this field is then being called into a List function and that must be trimming although I'm not invoking the Trim function myself anywhere.
Does List automatically Trim?
List does not trim out spaces, but it will omit list elements with null values.
List ( "value1" ; "" ; "Value 3" )
So if all the fields are empty and you left the "do not evaluate if all fields are empty" check box selected, that might explain your results.
Sorry to have misled you, I did some digging and found bot the calculation and List function are behaving correctly.
The result is being set to a variable which in turn is used as the body of a Send Email step in a script. It is at the email stage that the spaces and tabs are being stripped.
I don't know if that's a function of Fielemaker's send email or the email client but I'll have to think of a workaround. One hack I thought of was to use a characters such as ~~~~~ to separate the fields then somehow set those characters to white or remove their colour. A hack, I don't like it but can't think of anything else t the moment.
Sorry but they should not be stripped in the email body either.
I pause the script at the penultimate step before Send Email and look at the field on the layout and the spaces are there. The variable is then set and used as the body of the email and the email is sent via email client not SMTP. The email has the spaces stripped. I can only assume it is the email client that is doing this. I shall investigate that and try another client but since I don't know what client the end users have I need to work around it anyway.
I will note (as you probably know already, but let's be sure) that emails sent out from FileMaker's Send Mail are plain text only. Not sure if that's a part of the problem here or not....
Yep, I know it sends as Plain Text but this is even before it sends. I don't have "Perform without dialogue" checked so I can preview the email before it's sent. And at that point the composition is without spaces.
On the other hand if I compose an email directly in the client as Palin Text it previews and sends the spaces.
It seems the Send Email script step itself is stripping the spaces when it resolves the field into the email body before sending
That seems highly unlikely.