ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#19953 - 05/18/08 01:04 AM screenswitching with touch buttons
rolfgka Offline
newbie


Registered: 05/11/08
Posts: 6
Hi there
im desperately trying to program a touch button screen switching, but looks like im too stupid.

This is my little test program:

0001 - IF Touch Anywhere Button #0, Button Leopard is pressed
0002 - AND Variable# 63 / Screen# is NOT = 1
0003 - THEN Variable# 63 / Screen# = 1
0004 - IF Touch Object #2, Button Leopard is pressed
0005 - AND Variable# 63 / Screen# is NOT = 1
0006 - THEN Variable# 63 / Screen# = 7
0007 - IF Touch Object #1, Button Leopard is pressed
0008 - AND Variable# 63 / Screen# is NOT = 7
0009 - THEN Variable# 63 / Screen# = 1
0010 - End Program
There are two test screens ( #1 and #7) with one button each.
if touched it should switch on screen 1 to screen 7 and on screen 7 back to one.
It beeps if touched, but nothing happens. Screen is a leopard II
(European version) Cmax version 2.00e5.

Any idea or hint how to handle it.

Thanks for any help
rolfgka (Germany)

Top
#19955 - 05/18/08 04:57 AM Re: screenswitching with ouch buttons [Re: rolfgka]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
Testing for which screen you're on when a button is pressed (like you're doing with the AND statements) is superfluous since to press any given button, you have to already be on the screen where it is defined. Here is how you could write a program to switch between screens, assuming that button #1 is defined on screen #1 and button #2 is defined on screen #7:

0001 - IF Touch Object #1, Button Leopard is pressed
0002 - THEN Variable# 63 / Screen# = 7
0003 - IF Touch Object #2, Button Leopard is pressed
0004 - THEN Variable# 63 / Screen# = 1
0005 - End Program
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#19957 - 05/18/08 07:04 AM Re: screenswitching with touch buttons [Re: Guy Lavoie]
rolfgka Offline
newbie


Registered: 05/11/08
Posts: 6
Thank you for your quick response.

ive used your program and added 2 lines.
After downloading it, there will be the "Leopard " intro screen.
when i touch it it beeps but doesnt switch.
Where am i wrong?

0001 - IF Touch Anywhere Button #0, Button Leopard is pressed
0002 - THEN Variable# 63 / Screen# = 1
0003 - IF Touch Object #1, Button Leopard is pressed
0004 - THEN Variable# 63 / Screen# = 7
0005 - IF Touch Object #2, Button Leopard is pressed
0006 - THEN Variable# 63 / Screen# = 1
0007 - End Program
ive created 2 buttons . one on screen 1 object #1 and one on screen 7 object 2#

thanks in advance /

Top
#19958 - 05/18/08 10:21 AM Re: screenswitching with touch buttons [Re: rolfgka]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
Try setting it to screen 1 initially this way instead (replace lines 1 and 2):

0001 - IF Variable #63 = 255
0002 - THEN Variable #63 = 1
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#19965 - 05/19/08 10:15 AM Re: screenswitching with touch buttons [Re: Guy Lavoie]
rolfgka Offline
newbie


Registered: 05/11/08
Posts: 6
Hey Guy,
worked perfect, thank you very much.
Im going on with my program, im shure itwas not my last question.

Top
Page 1 of 1 1


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie, Bobkat 
Hop to:
Who's Online
0 registered and 64 anonymous users online.
Recent Posts
Cmax Message: Failed to set data for a 'delay'
by John Vomastic
07/03/17 10:14 PM
Shout Box

Newest Members
brigiel, vevevie, zhutree, 416, saiqul
3003 Registered Users
Forum Stats
3003 Members
19 Forums
4000 Topics
23426 Posts

Max Online: 132 @ 11/13/16 10:07 AM
July
Su M Tu W Th F Sa
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31