Page 1 of 1

How to enter delay as a time in the Calculation box.?

Posted: Mon Feb 04, 2019 1:14 pm
by astro1234
Hi.
Can i use the calculation icon to enter a delay for time.
Example i make a var called Delay, then in the calculation box enter Delay = 100 milliseconds
How can i enter time in milliseconds/ or fraction of seconds in the calculation box.
Win 10 pro
Flowcode V8.1
Thanks Roy.

Re: How to enter delay as a time in the Calculation box.?

Posted: Mon Feb 04, 2019 2:35 pm
by medelec35
Hi Roy,
Delay icons accept variable names:
Variable Delay.png
(11.35 KiB) Downloaded 974 times
I'm not sure if there are any limits on the maximum value you can use but I believe the delays can be greater than 255 if required.

Re: How to enter delay as a time in the Calculation box.?

Posted: Mon Feb 04, 2019 3:32 pm
by astro1234
Tried that out, would only work up to 255,
so changed the number format to int, and it works ok.
Thank you.
Regards Roy.

Re: How to enter delay as a time in the Calculation box.?

Posted: Tue Feb 05, 2019 6:40 pm
by medelec35
Hi Roy,
You're welcome,
Glad it's working for you.
Yes, you will need to change the variable type to reflect the value you're after.
For example, if you require a 300ms delay and the variable used is a byte, then the actual delay will be 300 - 256 = 44ms
The is because if you add 1 to a byte value of 255 then instead of being 256 the byte roles over to 0.
Reason being a byte in flowcode has the range of 0 to 255 only.
Best to use UInt as that goes from 0 to 65535