Fill Line With Blank Space

Hello,

Is there any way to fill a textline with blank spaces using a function or something like this?

And don’t send me that terrible documentation, i’ve already looked at there.

Att,

Ramon.

The function is ALL().

1 Like

There is also the repeat count notation. From the help:

Consecutive occurrences of the same character within a string constant may be represented by repeat count notation. The number of times the character is to be repeated is placed within curly braces ( { } ) immediately following the character to repeat.

So if you know the number of characters you could do this:

myVariable = '<32>{255}'

If your textline is a STRING() variable, you can just CLEAR() it or assign '' to it. It will be filled with blank spaces.

All these do the same thing to the str variable:

str STRING(100)
CODE
  
  str = ' {100}'
  str = ALL(' ',100)
  str = ' '
  str = ''
  CLEAR(str)
1 Like

Yeah, ALL is very handy

Both of these have a single space for the first argument.

MyVar = ALL(' '   , SIZE(MyVar))  
MvVar = ALL('<32>', SIZE(MyVar))

But it’s even more flexible, it doesn’t have to repeat just a single character.

MyVar = '[' & ALL('Hi<32> ', 3)  & ']'

MyVar now holds [Hi Hi Hi ]

1 Like