Skip to main content
4-Participant
June 30, 2026
Solved

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

  • June 30, 2026
  • 4 replies
  • 150 views

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
};

 

Best answer by terryhendicott

Hi,

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

4 replies

Community Moderator
July 10, 2026

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

4-Participant
July 22, 2026

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

 

21-Topaz II
July 23, 2026

Hi,

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

4-Participant
July 26, 2026

Thanks terrihendicott,

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

Kind regards.