>>>>I would recomend that you use
CEILING(SQRT(OCCURS(SPACE(1),lcStr)))) to make overall size of the expression shorter. With long source string you could exceed 8,192 characters limit on the command line size.
>>>
>>>Ok, so basically, this is the new formula.
>>
>>Yes, it determines how many times you've to run STRTRAN(..., SPACE(2), SPACE(1)) on the source string to eliminate extra spaces in the worst case scenario.
>
>Can you send the entire line with this adjustment? I can't find a way to make it fit.
There was extra closing parenthesis at the end of expression, sorry. Here's working code.
? EVALUATE(REPLICATE([STRTRAN(], ;
CEILING(SQRT(OCCURS(SPACE(1),lcStr)))) + [lcStr] + ;
REPLICATE([, SPACE(2), SPACE(1))], ;
CEILING(SQRT(OCCURS(SPACE(1),lcStr)))) )
* Or for readability you can split in into two lines
lnRepCount = CEILING(SQRT(OCCURS(SPACE(1),lcStr)))
? EVALUATE(REPLICATE([STRTRAN(], lnRepCount) + [lcStr] + ;
REPLICATE([, SPACE(2), SPACE(1))], lnRepCount))
--sb--