03-26-2020 09:18 AM
I want to use a variable generated from a dialog box to be used to generate an offset. Am I able to use variables in that calculation?
The script I'm trying to use is
Dim MyInput
MyInput = InputBox("Enter Fixture Grove Depth In Inches","DIAdem","")
Call MsgBox("You entered: " & MyInput)
'Add Fixture Height Offset of 0.115 inches
Set ChnResult = ChnOffset("[2]/Absolute Encoder 1", "/Absolute Encoder 1", MyInput, "free offset")
Set ChnResult = ChnOffset("[2]/Absolute Encoder 2", "/Absolute Encoder 2", MyInput, "free offset")
Set ChnResult = ChnOffset("[2]/Absolute Encoder 3", "/Absolute Encoder 3", MyInput, "free offset")
When I use a number, rather than the variable "MyInput" it works. I'm new at all this, is there anything additional I need to use that variable?
Thanks
03-27-2020 04:56 AM
MyInput is a string.
Dim MyInput
MyInput = InputBox("Enter Fixture Grove Depth In Inches","DIAdem","")
MyInput = CDbl(MyInput)
Call MsgBox("You entered: " & MyInput)
Adding a string number conversion will work. Be aware that the CDbl is depending on local setting according to decimal point.