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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

User Input Box

ptc-3805609
1-Newbie

User Input Box

Hello,

New to MC15 but getting along with the help of Google and this forum.

One question that I have yet to answer and would appreciate some basic help:

I want to be able to change a variable value via text box. However a text box formats entries as a string. I have researched it pretty extensively but with no joy.

Can anyone tell me how to easily get a text box to output a numeric value and not a string? I do not need to validate the info just have it spit out the numeric.

Much appreciated.

Thanks,

Chris

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:ptc-3805609)

Inside the listbox script, use the VBscript CDbl() function.

Outputs(0).Value = CDbl(TextBox.Text)

View solution in original post

3 REPLIES 3
RichardJ
19-Tanzanite
(To:ptc-3805609)

Inside the listbox script, use the VBscript CDbl() function.

Outputs(0).Value = CDbl(TextBox.Text)

Richard,

Thank you.

That worked. I also found that I could use "WebControls."

Thanks again.

Chris

The other way is to use the built-in function "str2num" (this function returns a constant formed by converting string into a number):

Pic_1.PNG

Top Tags