Skip to main content
17-Peridot
June 27, 2013
Question

How to Convert a String Parameter to a Real Number Parameter?

  • June 27, 2013
  • 1 reply
  • 1084 views

See the Attachment。

    1 reply

    17-Peridot
    June 27, 2013

    Interesting question.

    I am almost sure you cannot do that directly.

    But you can do an evaluation of "A"

    If there is only a fixed number of "lengths"... values for "A", you can to a inverse comparison:

    If A="150"

    L=150

    If A="100"

    L=100

    If A="50"

    L=50

    endif

    endif

    else

    L=1

    endif

    (something like that...) not positive about the syntax but you get the idea. Just remember the "else" statement in case you run into an anomaly.

    ...and if the variety of "lengths" is too great, you can just build the if statements using one digit at a time and sum the value as multiples. Through 999, you would only have 27 if statements; 9999 would be 36 if statements. I trust they are always whole numbers?

    ...if A^1= 2 then L^1=200 if A^2=9 then L^2=90 if A^3=5 then L^3=5 L=L^1+L^2+L^3

    Of course, you also have to evaluate the length of A to determine the multiplier.