Jump to content

Adding Double Space


Recommended Posts

Hi, I have a simple rule that adds a space after whatever someone enters is a field on a template:

 

return Field("Address1") + String("&nbsp");

 

and I am trying to make it two sapces, but it seems like no matter how I try to add a second &nbsp I still only get one space. Is there a way to set a rule for more than one space? I don't want to add the spaces in the text editor window, becuase I have the fields set to suppress if empty and don't want the space to be there if the filed is left blank.

 

Thanks

Link to comment
Share on other sites

Hi, I have a simple rule that adds a space after whatever someone enters is a field on a template:

 

return Field("Address1") + String("&nbsp");

 

and I am trying to make it two sapces, but it seems like no matter how I try to add a second &nbsp I still only get one space. Is there a way to set a rule for more than one space?

The problem is that your entity is incomplete; you need a semicolon at the end (as part of the string literal), like this:

return Field("Address1") + " ";

(Also, the String constructor is unnecessary; a string literal, denoted with quotes, is already a string.)

 

You can chain as many of these as you want, and you'll get more space between the Address1 field and whatever else comes after it on the line:

return Field("Address1") + "    ";

Of course, if there's nothing else after the field value on the line, you won't "see" any invisible spaces.

I don't want to add the spaces in the text editor window, becuase I have the fields set to suppress if empty and don't want the space to be there if the filed is left blank.

That's what the "Suppress if Containing Empty Variables" setting is for.

Link to comment
Share on other sites

Ok thanks, using the extra semicolon worked, and unfortunately there are other variables on the same line so the suppress if containing empty variables doesn't work for me in this case. But now that you gave me the answer, I think I can make it work this way.

 

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...