Mathcad prime 10. Advanced Controls. List. Writing a script on JS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Mathcad prime 10. Advanced Controls. List. Writing a script on JS
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.
- Labels:
-
Other
-
Programming
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
> 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
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Like this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
> 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
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This is exactly what i wanted, thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
