Why space when formatting a logical value.

TomBascom

Curmudgeon
It aligns the width with “false”.

A format of yes/no will do the same thing in reverse.

Male/female will give you 2 spaces.
 

Cecil

19+ years progress programming and still learning.
Thanks Tom.

I have never noticed this until today.

I could argue that this is a bug, but what’s the point as it is possibly the “expected behaviour”.

I just will have to go and edit every string function that is formating a logical value.
 

Cringer

ProgressTalk.com Moderator
Staff member
You really notice it when you use a silly format to do something clever like STRING(lVal,"Hot/Freezing").
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
I could argue that this is a bug, but what’s the point as it is possibly the “expected behaviour”.
I think it has to do with compile-time checking of whether the message/display will fit within the containing frame or window. So it positions the second "<indicator>" where it needs to be to fit whatever value might come before it.
 

tamhas

ProgressTalk.com Sponsor
Rob is on point. As written, the formatting is being done at compile time so room needs to be left for the longest possible value. If that is not what you want, compose the string in advance, clean up as needed, and display the string as a whole ... or, use put unformatted, which would be appropriate for outputting HTML, JSON, and the like.
 
Top