I use the GoTo statement (although rarely) and I too never intend it to be a round trip. One thing I make it a practice to do is to add a comment of exactly why and where this is going. That way I never have to worry about it getting "broken".
The navigate icon is so easy to use but when the link gets broken, it's a nightmare trying to figure out where it was sending you. How many take the time to add a comment to these?
-- Barbara A Brown B A Brown & Associates http://www.babrown.com barbara@babrown.com
"MORALES, RAMON [NCP/1555]" wrote:
> Since it's Friday and since we haven't had a good holy > war on the list for at least a couple of days now, I > will introduce a heretical position. > > The infamous GoTo()is not evil. No more than handguns are evil. > It is just a tool that needs to be handled carefully. If it > were as useless and dangerous as most people seem to claim, why > have Jamil and friends kept it in all the upgrades? > > Most of the bad comments revolve around two issues. Most importantly, > AuthorWare has a tendency to get lost sometimes when GoTo()s > are used as part of a round trip (you go somewhere via the GoTo() > and hope to get back when you are done). The other is the ever > popular "spaghetti code" issue. If you use too many GoTo()s, the > code gets so convoluted that it becomes hard to track down what is > going on. > > Knowing this, I have successfully used GoTo()s occasionally in my code > with no negative consequences. Yes there are alternate ways of doing > what I did that I could have used to avoid them, but this way I avoided > having to spend additional project time learning about branching issues > and decision icons, etc. My code is working and in production and when > (or if) I have time, I can go back and learn about better ways of doing > what I did. The point is that if it works as well as the alternatives, > people shouldn't be so crabby just because the general propaganda about > it is negative. See what works and then use it. > > For me, I have used GoTo()s successfully by following these rules: > 1. Keep the universe of the GoTo()s self contained. If I use them, > all their movements (i.e. where they are going to and where they > came from) are located in the same map icon. That way it is easy > to track what is going on because you have a finite place to look. > 2. All my GoTo()s are one way. They are never expected to return. Like > if I select a background and move on with the program, never to > return. > Can't get lost because there is no round trip. > > As you can see from the rules, the opportunities for using GoTo()s safely > may be > fairly limited. There will be times when it could be useful. But you won't > find out unless you look around and see what it can do. > > I'm going into the bomb shelter now because I can see that the flame > throwers > are starting up. > > ____________________________________________ > Ramon Morales > Software Consultant
-- Search the Archives -- UPDATED EVERY DAY!! http://www.e-media.nl/aware/search.html
The AWARE List http://www.e-media.nl/aware/index.html
Netiquette: !! Use descriptive subject fields !! Delete all unneeded lines from your reply
- Use subject prefixes (A5 , A5Mac , A5Web , KO , UCD , OT)