Formatting a field

It seems like Scriptcase is trimming the fields when building the field.
In the OnLoad record from a form I select four fields from the database. There are more than one record.
I created a text field to display the records , and I would like to build the fields to display the records.
I have tried using concat in the select to create on field with formatting in the sql select. This does not work
I have tried using str_pad({dataset}->fields[0],15,’ ') with spaces. This does not work
I have tried str_replace and this does not work either

Assign the fields is easy, but I am battling to format the fields in a table format so that it displayed
{text_field} = {dataset}->fields[0].’ ‘.{dataset}->fields[1].’ ‘.{dataset}->fields[2].’ '.{dataset}->fields[3],"
".;

Any suggestions

I would do the concat in the sql instead of onLoad