Weird formatting of integer values of LIST-ITEM-PAIRS combo-box

Keith G.

Member
I recently ran across something weird with integer data type list-item-pairs combo-boxes. (The environment is Windows 10, OpenEdge 11.6.) I have found that the integer values in the string list found in the LIST-ITEM-PAIRS property are formatted with leading spaces.

So, when I assign a LIST-ITEM-PAIRS property with this string:
Code:
"One|1|Two|2|Three|3"
When I subsequently retrieve that property value, it looks like this:
Code:
"One|         1|Two|         2|Three|         3"
Each integer value list item is formatted to a width of 10 characters.

Has anyone else noticed this? Am I overlooking something that would be the cause?
 

Stefan

Well-Known Member
The format determines how the values are formatted:

Code:
def var hw as handle.

create combo-box hw.
assign
   hw:delimiter = '|'
   hw:list-item-pairs = 'one|1|two|2'
   .

message hw:list-item-pairs view-as alert-box.

hw:format = '         9'.

message hw:list-item-pairs view-as alert-box.

Also beware that the format is a character format and not a number format.
 

Keith G.

Member
The format determines how the values are formatted:
I was assuming that a ">" character in the format string meant that position is only filled when there is a non-zero digit in that position. It seems that it really means put a space character there if no significant digit is applicable.

Thanks for the explanation.
 
Top