Offline
Newbie
Karma: 0
Posts: 4
|
 |
« on: January 02, 2013, 07:58:23 am » |
Hi I'm new with Arduino and I'm using the TFT touch shield from Seeed studio.
I want to be able to go to different parts of my program like creating subroutines “ pages” on my touch screen. on each page I want to control or receive inputs from different devices. I'm trying the togo command it works only to one page but as I add a another page it sometimes go to the correct page or to the other page. what is the best way to move to a section of a program and work there, without going back until I want to.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Malaysia
Offline
Sr. Member
Karma: 7
Posts: 385
|
 |
« Reply #2 on: January 02, 2013, 10:33:36 am » |
maybe what you could do is the use the switch statement...
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19006
I don't think you connected the grounds, Dave.
|
 |
« Reply #3 on: January 02, 2013, 11:04:15 am » |
I'm trying the togo command It's "goto", and should only be used when you really know what you're doing. Try to pretend it doesn't exist.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Poole, Dorset, UK
Offline
God Member
Karma: 8
Posts: 669
|
 |
« Reply #4 on: January 02, 2013, 07:17:23 pm » |
Anyone using goto's in ther code should be flogged!.
Mark
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
|
 |
« Reply #5 on: January 02, 2013, 08:39:04 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #6 on: January 03, 2013, 01:00:28 am » |
Anyone using goto's in ther code should be flogged!.
Flogging Considered Harmful.
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6313
-
|
 |
« Reply #7 on: January 03, 2013, 10:20:03 am » |
What's the name of that construction which uses goto and a switch to do a non-word-aligned memory copy? I remember that after I eventually figured out what it was doing, it felt like it shouldn't have been allowed but obviously was. I've been wracking my brain trying to remember the chap that it was named after, but it's not coming to me. Anyone remember?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19006
I don't think you connected the grounds, Dave.
|
 |
« Reply #8 on: January 03, 2013, 10:21:26 am » |
(Tom) Duff's Device
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Sr. Member
Karma: 7
Posts: 386
|
 |
« Reply #9 on: January 03, 2013, 11:38:50 am » |
As Duff himself said: This code forms some sort of argument in that debate [about C's fall through behaviour], but I'm not sure whether it's for or against.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 4
|
 |
« Reply #10 on: January 03, 2013, 01:03:40 pm » |
Sorry its goto... My bad... Nobody has anything?
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6313
-
|
 |
« Reply #11 on: January 03, 2013, 01:15:51 pm » |
That's the lad. It still makes my head hurt, even after all these years.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 5
Posts: 397
|
 |
« Reply #12 on: January 03, 2013, 01:24:21 pm » |
Sorry its goto... My bad... Nobody has anything?
All I have is that if you are using C++ and you think you need a goto then you are doing something wrong. Maybe explain what you want it to do and let these guys help you find the right way which I can guarantee won't have a single goto.
|
|
|
|
|
Logged
|
|
|
|
|
Temple, Texas
Offline
Sr. Member
Karma: 14
Posts: 354
|
 |
« Reply #13 on: January 03, 2013, 01:39:02 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #14 on: January 03, 2013, 02:33:43 pm » |
what is the best way to move to a section of a program and work there, without going back until I want to.
Call a function (subroutine) and not return until you want to.
|
|
|
|
|
Logged
|
|
|
|
|
|