Mathcad Prime 10 - Text Box Advanced Controls
- May 24, 2024
- 2 replies
- 3634 views
Hi,
I am trying to configure the new MCP10 Text Box Advanced Controls.
I want to use the Text Box as a PASS/FAIL display but I am having two issues.
1) How do I pass more than one input into the Text Box? Currently, I can only add one input.
2) How do I display text that is a result of the JScript routine in the box? (similar to how the Advanced Controls demo was shown in MCP10 promo, i.e., PASS = green, FAIL = red and so on).
Currently, because I cannot pass slider_test and Limit into the Text Box, I have manually set Limit = 5 in JS (testing code).

var slider_test; // Define the external variable
var test;
var Limit;
var limit;
function TextBoxEvent_Start(Inputs, Outputs) {
// Assign the value of 'slider_test'
slider_test = Inputs[0].Value; // Ensure this correctly gets the input value
Limit = 5; // Ensure this correctly gets the input value
test = slider_test
limit = Limit
}
function TextBoxEvent_Exec(Inputs, Outputs) {
// Output "PASS" or "FAIL" based on the value of 'slider_test' with the criterion slider_test > 1
if (test > limit) {
Outputs[0].Value = "PASS";
} else {
Outputs[0].Value = "FAIL";
}
}
function TextBoxEvent_Stop(Inputs, Outputs) {
// TODO: Add your code here
}


