Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
I have an array (numbers of rows - 1, number of columns - can be different). Example: I enter a variable in mathcad d = [1 5 10 15] and i want this array to be displayed in my list as d = 1 d= 5 etc... Help please. Preferably in JS. Translated using Google Translate.
Solved! Go to Solution.
> i want this array to be displayed in my list as d = 1
Which list? And where? An external text file?
Please specify more precisely and if possible give one or two examples to show what you are looking for.
Ahh, you shouldn't hide important informations just in the thread subject!
In case you are looking for a vector to be the input for the items of a list box, you will find some examples here in the forum - some more , some less sophisticated.
A simple one is attached - hope it helps
// TODO: Add your initialization code here
// Initialize Selection If desired
ListBox.CurSel(0);
function ListBoxEvent_Start(Inputs, Outputs) {
// TODO: Add your code here
};
function ListBoxEvent_Exec(Inputs, Outputs) {
var options = Inputs[0].Value;
ListBox.ResetContent()
for(var i=0; i < options.length; i++) {
ListBox.AddString(options[i]);
}
Outputs[0].Value = options[ListBox.CurSel()];
};
function ListBox_SelChanged(Inputs, Outputs) {
// TODO: Add your code here
};
function ListBox_DblClick(Inputs, Outputs) {
// TODO: Add your code here
};
Like this?
> i want this array to be displayed in my list as d = 1
Which list? And where? An external text file?
Please specify more precisely and if possible give one or two examples to show what you are looking for.
Ahh, you shouldn't hide important informations just in the thread subject!
In case you are looking for a vector to be the input for the items of a list box, you will find some examples here in the forum - some more , some less sophisticated.
A simple one is attached - hope it helps
// TODO: Add your initialization code here
// Initialize Selection If desired
ListBox.CurSel(0);
function ListBoxEvent_Start(Inputs, Outputs) {
// TODO: Add your code here
};
function ListBoxEvent_Exec(Inputs, Outputs) {
var options = Inputs[0].Value;
ListBox.ResetContent()
for(var i=0; i < options.length; i++) {
ListBox.AddString(options[i]);
}
Outputs[0].Value = options[ListBox.CurSel()];
};
function ListBox_SelChanged(Inputs, Outputs) {
// TODO: Add your code here
};
function ListBox_DblClick(Inputs, Outputs) {
// TODO: Add your code here
};
This is exactly what i wanted, thank you
@panzerbaha wrote:
This is exactly what i wanted, thank you
Glad you got what you needed.
So you may consider closing the thread unless there are additional related questions.