cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Prime 10 Text box

DZ_7358918
5-Regular Member

Prime 10 Text box

Hi. As a beginner I looked at

https://community.ptc.com/t5/Mathcad/Mathcad-Prime-10-Text-Box-Advanced-Controls/m-p/952250#M212068 ...

and tried to modified it to a simple comparison if a value "a" is less or bigger than 1. For example an unit check of stress in some member is a=0.86. If a < 1 then member pass, if a => 1 then member fails. But a message "a" is undefined at row xxx appeared and I could not find a reason. I am sure that it is easy for experienced people in JScript. Thanks. D.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:DZ_7358918)

You would have to attach the sheet with the failing component.

If you get the message you described it means that you had used variable name "a" in your script. have you defined variable "a" in your script and assigned it to the input variable? Note that you can't expect the script to know the variable name of a Prime variable.

 

View solution in original post

2 REPLIES 2
Werner_E
25-Diamond I
(To:DZ_7358918)

You would have to attach the sheet with the failing component.

If you get the message you described it means that you had used variable name "a" in your script. have you defined variable "a" in your script and assigned it to the input variable? Note that you can't expect the script to know the variable name of a Prime variable.

 

DZ_7358918
5-Regular Member
(To:Werner_E)

Hi. Thanks for a prompt answer. Finally I have found where I did a mistake.

It was surprise for me that when I gave away rows with definitions of TextBox colors,

the color of field stayed as  it was at that moment, so green, when it was green or red when it was red:

   TextBox.Font.Size = 23;
   if (Inputs[0].Value[0] > Inputs[0].Value[1]) {
         TextBox.BackColor(0x00BB00);
         TextBox.ForeColor(0xFFFF00);
         TextBox.Text("PASS"); 
   } else {
  TextBox.BackColor(0xFFCCCC);
              TextBox.ForeColor(0xCC0000);
TextBox.Text("FAIL");
 
When I rewrite rows into a new command of TextBox,  result was without color -  transparent field.
I could not find till now where I can define field properties.
Have a nice day.
D.
Announcements

Top Tags