Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
flip Senior Member Joined: 18/07/2016 Location: AustraliaPosts: 114
Posted: 12:17am 19 Jun 2017
Copy link to clipboard
Print this post
Hi all, Hoping someone can confirm what I'm doing is OK. I had something like the following in a program and it worked fine as a routine, but when I test a cut down version in command mode it always returns 0 for the x parameter(stored in variable a). the y parameter is correct.
Do a=Touch(x):b=Touch(y):If a>-1 And b>-1 Then print a,b ELSE b=b:EndIf:Loop
Same problem evident with 5.04.04 on a standard uMite and 5.03.o on a uMite+
eg. output like 0 162 0 163 ... Hope it's nothing like x being treated as a variable rather than a literal parameter?
PhilEdited by flip 2017-06-20
flip Senior Member Joined: 18/07/2016 Location: AustraliaPosts: 114
Posted: 12:22am 19 Jun 2017
Copy link to clipboard
Print this post
...interestingly when i try
Do b=Touch(y):a=Touch(x):If a>-1 And b>-1 Then print a,b ELSE b=b:EndIf:Loop
then the y variable gets lost... e.g. 234 0 235 0 ...
Regards, Phil
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10246
Posted: 01:32am 19 Jun 2017
Copy link to clipboard
Print this post
You are missing the colon after "DO"
flip Senior Member Joined: 18/07/2016 Location: AustraliaPosts: 114