Spin question
RichardF
Posts: 168
Anyway to do this:
···· if acknowledge
······· 'do this
Where acknowledge is the result of reading·status of ina[noparse][[/noparse]pin].
or:
···· repeat until done
······· 'do something else
Where done is the result of reading status of ina[noparse][[/noparse]pin].
I guess this would be like a macro and would make for easier to understand code.
Thanks,
Richard·
···· if acknowledge
······· 'do this
Where acknowledge is the result of reading·status of ina[noparse][[/noparse]pin].
or:
···· repeat until done
······· 'do something else
Where done is the result of reading status of ina[noparse][[/noparse]pin].
I guess this would be like a macro and would make for easier to understand code.
Thanks,
Richard·
Comments
You can also declare a variable "acknowledge", do "acknowledge := ina[noparse][[/noparse]pin] == 1", then do "if acknowledge".
The case with the repeat is a little more difficult. If "done" is a complex condition, you could declare it as a method like:
You could then do your "repeat until done".
repeat
if ina[noparse][[/noparse]pin] 'acknowledge
'do ......
or
if not ina[noparse][[/noparse]pin] 'not ready
'do ...
Thanks,
richard