Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
reading floating point values
#1
I'm trying to allow the user to enter a floating point (real) value for use as a delay. Here's the code I'm using:

str s
double+ delay
inp s "Enter delay in [fractional] seconds" "" "0.5"
delay = val(s)
out "%4.1f" delay

The "out" produces the value " 0.0", which explains why none of the delays are working correctly.

Any hints?

Thanks!

Smile

Jon
#2
use the type flag in val.

Code:
Copy      Help
delay = val(s 2)
An old blog on QM coding and automation.

The Macro Hook
#3
Or use delay with inp directly.


Forum Jump:


Users browsing this thread: 1 Guest(s)