Skip to main content
4-Participant
Jun 30, 2026 9:57 PM UTC
Solved

Advanced Controls - List Box - Selection won't map to output

Hi. I am trying to use an advanced list box to select a beam section from the first column in a matrix that I can then use to lookup related properties further on in my calc sheet. The problem I have is that the selection does not get parsed to the output variable. Any help with this would be appreciated, I can’t seem to find anything useful online, but I am clearly missing some detail.

Here is the list box code and MathCAD file attached.
 

// TODO: Add your initialization code here

function ListBoxEvent_Start(Inputs, Outputs) {
// TODO: Add your code here
};

function ListBoxEvent_Exec(Inputs, Outputs) {

// 1. Clear the list box contents FIRST to reset it
ListBox.ResetContent();

var options = Inputs[0].Value;

// 2. Loop through and add the strings
for(var i=0; i < options.length; i++) {
ListBox.AddString(options[i]);
}
// 3. Set your output
Outputs[0].Value = options[ListBox.CurSel()];
//Outputs[0].Value = ListBox.get_text(ListBox.CurSel());
};

function ListBoxEvent_Stop(Inputs, Outputs) {
// TODO: Add your code here
};

function ListBox_SelChanged(Inputs, Outputs) {
// TODO: Add your code here
};

function ListBox_DblClick(Inputs, Outputs) {
// TODO: Add your code here
};

 

terryhendicott
21-Topaz II
Jul 23, 2026 6:34 PM UTC

Hi,

Try this has list box to select section, and list box to select property column

4 replies

Community Moderator
Jul 10, 2026 5:18 AM UTC

Hi ​@RD_14433426,

Thank you for your question. 

Your post has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.

Also, feel free to add any additional information you think might be relevant. It sometimes helps to have screenshots to better understand what you are trying to do.

Thanks,
Vivek N
Community Moderation Team

Translate
4-Participant
Jul 22, 2026 12:33 AM UTC

Thanks Vivek.

 

Screenshot below of me trying to capture output of ListBox in a variable. I don’t understand why it isn’t retained in the variable as it just remains null / zero. When I click on the list box it does not highlight the selection or send the clicked value to the output. 

 

Screenshot of List Box and selection output

 

Translate
terryhendicott
21-Topaz II
Jul 23, 2026 6:34 PM UTC

Hi,

Try this has list box to select section, and list box to select property column

Translate
4-Participant
Jul 26, 2026 10:18 PM UTC

Thanks terrihendicott,

Appreciate your effort on this one. It works. Perhaps I was trying to be too lazy/smart, not sure which :-)

Kind regards.

Translate