Subscribe Bookmark RSS Feed

Trouble displaying a list

jflynn

Community Trekker

Joined:

Jan 14, 2015

Hello All,

I apologize for the very basic question. I have a larger script that I am working on, I've narrowed down my current issue to the following situation. I've simplified the code as well.

My goal is to populate a list and this newly populated list is then summarized in a new Window. I am able to properly populate the empty list and create the new window, however the contents of the list are not present. Debugger does not catch any issues with the script and I have been unsuccessful in finding anyone with a similar issue.

I've tried all the variations I could think of and each window created in the code below provide me with new windows with empty lists. I need the contents of the list displayed in the window still.

Again, I'm sure I'm missing something very basic and I appreciate your patience and help!

Here's the code, thanks again for your help:

ListToBePopulated2 = {1,2,3,4,5};

SummaryWindow2 = New Window("Summary Window",

  Text Box("Summary of Values Entered2"),

  Outline Box("Section #2",

  H List Box(

  Outline Box("Group2", List Box(ListToBePopulated2))

  )

  )

);

ListToBePopulated3 = {};

for(i=1, i<=6, i++, ListToBePopulated3 = i );

SummaryWindow3 = New Window("Summary Window",

  Text Box("Summary of Values Entered3"),

  Outline Box("Section #3",

  H List Box(

  Outline Box("Group3", List Box(ListToBePopulated3))

  )

  )

);

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

The lists for List Box need to contain characters, not numbers.  This code works:

ListToBePopulated2 = {"1", "2", "3", "4", "5"};

SummaryWindow2 = New Window( "Summary Window",

    Text Box( "Summary of Values Entered2" ),

    Outline Box( "Section #2",

        H List Box( Outline Box( "Group2", List Box( ListToBePopulated2 ) ) )

    )

);

ListToBePopulated3 = {};

For( i = 1, i <= 6, i++,

    ListToBePopulated3[i] = Char( i )

);

SummaryWindow3 = New Window( "Summary Window",

    Text Box( "Summary of Values Entered3" ),

    Outline Box( "Section #3",

        H List Box( Outline Box( "Group3", List Box( ListToBePopulated3 ) ) )

    )

);

2 REPLIES
Solution

The lists for List Box need to contain characters, not numbers.  This code works:

ListToBePopulated2 = {"1", "2", "3", "4", "5"};

SummaryWindow2 = New Window( "Summary Window",

    Text Box( "Summary of Values Entered2" ),

    Outline Box( "Section #2",

        H List Box( Outline Box( "Group2", List Box( ListToBePopulated2 ) ) )

    )

);

ListToBePopulated3 = {};

For( i = 1, i <= 6, i++,

    ListToBePopulated3[i] = Char( i )

);

SummaryWindow3 = New Window( "Summary Window",

    Text Box( "Summary of Values Entered3" ),

    Outline Box( "Section #3",

        H List Box( Outline Box( "Group3", List Box( ListToBePopulated3 ) ) )

    )

);

jflynn

Community Trekker

Joined:

Jan 14, 2015

Thank you very much PMroz!