Post a reply to the thread: Padding variables with spaces/blanks
Click here to log in
What's the name of our main installation product (in uppercase letters), directly followed by the current year?
You may choose an icon for your message from this list
Will turn www.example.com into [URL]http://www.example.com[/URL].
Re: Padding variables with spaces/blanks Hi Jerry, in the current SB version it always truncates trailing spaces. In earlier versions of SB, it truncated both leading and trailing spaces. We are experimenting right now in SB 2023 how to change this behavior. But in the current version it is definitely not possible! Friedrich
Re: Padding variables with spaces/blanks
Re: Padding variables with spaces/blanks Hey, Friedrich, it's been about 3 weeks now. Any word on this yet?
Re: Padding variables with spaces/blanks Hi Jerry, Good question. I'll have to play with it and get back to you! Friedrich
Padding variables with spaces/blanks I have searched through the forum and not found anything on this SetupBuilder scripting topic, so here's the question I'm posing. Is it possible to pad a character string with trailing spaces or blanks? From how I've seen SetupBuilder scripting act, it seems that if there are trailing spaces/blanks in a variable, it truncates them automatically when doing any kind of operation with the variabe, and there doesn't seem to be anything you can do to keep the trailing space(s) in the variable. For example, in this following SetupBuilder script code, I set the values of the first two variables to have a trailing space . . . Set Variable %OUTPUT_FIELD1% to "SetupBuilder " Set Variable %OUTPUT_FIELD2% to "is " Set Variable %OUTPUT_FIELD3% to "awsome!" Set Variable %OUTPUT_LINE% to %OUTPUT_FIELD1%%OUTPUT_FIELD2%%OUTPUT_FIELD3% I would expect the content of the %OUTPUT_LINE% variable to have a value of (excluding the quotes) "SetupBuilder is awesome!" . . . but it's doesn't. Because SetupBuilder is truncating the trailing spaces when it evaluates them and performs an operation on them, the value ends up being "SetupBuilderisawesome!" If I were to using the same example, only with leading blanks instead of trailing blanks, the results are different. SetupBuilder will keep leading blanks when doing the operations. Set Variable %OUTPUT_FIELD1% to "SetupBuilder" Set Variable %OUTPUT_FIELD2% to " is" Set Variable %OUTPUT_FIELD3% to " awesome!" Set Variable %OUTPUT_LINE% to %OUTPUT_FIELD1%%%OUTPUT_FIELD2%%OUTPUT_FIELD3% In the above case, the value of %OUTPUT_LINE% will be "SetupBuilder is awesome!" . . . keeping the leading spaces. So, my question is why does SetupBuilder seem to automatically truncate trailing spaces when doing operations on character strings, and how can you circumvent that (if possible)?
Padding variables with spaces/blanks
Forum Rules