Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:12 01 Aug 2025 Privacy Policy
Jump to

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.

Forum Index : Microcontroller and PC projects : TOUCH(DOWN) Problem

Author Message
PhilTilson
Newbie

Joined: 15/11/2015
Location: United Kingdom
Posts: 35
Posted: 07:17pm 19 Nov 2018
Copy link to clipboard 
Print this post

I have a very odd problem - which I am sure the gurus on this forum will easily explain!

I am getting to grips with the Touch side of the MM+ and have a simple routine to detect a touch and change the colour of a character under the touch point.

This works fine for individual touches. I then wanted to add a couple of lines so that, while the touch was present, the routine was run continuously in order to allow a 'swipe' across the characters. The relevant part of the code is this:
sub PenDown
do
if touch(y)>159 and touch(y)<168 then
xx%=int((touch(x)-169)/6)*6+170
text xx%,160,";","LMN",8,1,rgb(yellow)
end if
loop if touch(down)
end sub

As soon as I touch the relevant part of the screen, I get the following message on the console:



This one has me stumped! I have tried rewriting the line in case a stray character got in there somehow, but it still does the same thing. Without the do-loop, all is fine.

Any thoughts?
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 08:50pm 19 Nov 2018
Copy link to clipboard 
Print this post

try
LOOP UNTIL

or Do WHILE

Jim
VK7JH
MMedit
 
PhilTilson
Newbie

Joined: 15/11/2015
Location: United Kingdom
Posts: 35
Posted: 10:45pm 19 Nov 2018
Copy link to clipboard 
Print this post

You are right, of course, Jim that I was using the wrong construction for my DO-WHILE loop. Now that I have corrected that, the program runs.

However, I still don't understand the error message! where did the 'å' come from?
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 11:44pm 19 Nov 2018
Copy link to clipboard 
Print this post

  PhilTilson said  
However, I still don't understand the error message! where did the 'å' come from?

Keywords get tokenised. I expect that 'å' is the token for TOUCH

Glad it's working now.
Jim

VK7JH
MMedit
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025