0

I am creating a selection-list, which needs to contain a list of names of persons. Currently, it looks as follows:

DEFINE VARIABLE sl-competitors AS CHARACTER FORMAT "X(60)":U
 LABEL "Competitors"
 VIEW-AS SELECTION-LIST MULTIPLE SCROLLBAR-VERTICAL
 LIST-ITEM-PAIRS "Alley Anna", "1", "Bower Bob", "2", "Chaplin Charlie", "3", "Drew Derek", "4", "Evon Eve", "5"

This is not what I want: I want the surname and the first name to be separated by a comma. Obviously this means that the delimiter, to be used in the selection-list, should be something else, and I agree with using a pipe character ("|", ASCII code 124).

However, it seems not to be possible to add a DELIMITER attribute at design time:

DEFINE VARIABLE sl-competitors AS CHARACTER FORMAT "X(60)":U
LABEL "Competitors"
DELIMITER "|" or DELIMITER 124 <== this is not accepted.
VIEW-AS SELECTION-LIST MULTIPLE SCROLLBAR-VERTICAL
LIST-ITEM-PAIRS "Alley Anna", "1", "Bower Bob", "2", "Chaplin Charlie", "3", "Drew Derek", "4", "Evon Eve", "5"

Also, adding commas in the names seems to give problems:

DEFINE VARIABLE sl-competitors AS CHARACTER FORMAT "X(60)":U
LABEL "Competitors"
VIEW-AS SELECTION-LIST MULTIPLE SCROLLBAR-VERTICAL
LIST-ITEM-PAIRS "Alley, Anna", "1", "Bower, Bob", "2", "Chaplin, Charlie", "3", "Drew, Derek", "4", "Evon, Eve", "5"

This is most probably caused by the fact that by default a comma is used.

How can I define the delimiter and the list of names, containing commas, at design time?

The usage of tools (appBuilder, PDSOE) is not helpful, as they don't allow to modify the delimiter.

1
  • How is the delimiter relevant when using the static list-item-pairs definition? Which problems does this seem to give? Commented Apr 2, 2021 at 15:43

1 Answer 1

1

you can do it later in the main-block or anywhere you want

Define Variable

DEFINE VARIABLE sl-competitors AS CHARACTER 
 VIEW-AS SELECTION-LIST MULTIPLE SCROLLBAR-VERTICAL

Assign List-Items

sl-competitors:DELIMITER = "|".
sl-competitors:LIST-ITEM-PAIRS = "Alley, Anna|1|Bower, Bob|2|Chaplin, Charlie|3|Drew, Derek|4|Evon, Eve|5".   

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.