[AccessD] Learning .Net -- PHP Instead?

Max Wanadoo max.wanadoo at gmail.com
Thu Jun 25 11:34:33 CDT 2009


I use goto a lot with labels. 

For example, today I wanted to run some code before the main stuff but I
only wanted to do it once but I didn't want to remove it.

So,

Goto Skip
Code2RunOnce

Skip:
Code here to always run



To run it once, I comment out the goto skip and then once it has run, I
uncomment it so it skips over the Code2RunOnce.

Now the purists amongst you will grimace and come up with all sorts of
alternatives, but for me it is easy peasy.  It works and it retains
visibility of what I have done.  If I need to run it again, a simple removal
of a single quote and it is back in action.

POWER TO ALL THE PEOPLE - RESISTANCE TO PURISTS IS NOT FUTILE.

Max



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: 25 June 2009 17:20
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Learning .Net -- PHP Instead?

Ummmmmm, that's not true, you can move forward with a Goto.  A Do Loop
IS always moving backwards.  With a goto, you can skip code, or go back.
And you can just as easily end up in a Do (or any loop, for next, while
wend) loop 'forever'.

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Thursday, June 25, 2009 1:57 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Learning .Net -- PHP Instead?

Hi Drew and John

The mistake by John here is that the Exit Loop and Exit For represent
only a very restricted GoTo as they only can exit to one specific point:
the end of the loop. That makes them very predictable. Still, I often
refrain from these and add a flag to raise or some other condition to
check to stop the loop.

The really ugly thing with GoTo is that is allows you to move backwards
in the code to run it over again - do I need to remind about being
caught in an endless loop caused by GoTo and some condition behaving
otherwise than intended? I do, from my time with Algol where the
compiler running on the IBM360 stopped those loops routinely (as we were
only students at the technical university). A nightmare there is no
reason to promote if you ask me.

/gustav


>>> DWUTKA at marlow.com 24-06-2009 23:58 >>>
Yep.  Wait a sec...are you and I in agreement?  Charlotte, just admit
defeat!!!  If JC and I agree on something, it HAS to be true! ;)

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Wednesday, June 24, 2009 2:24 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Learning .Net -- PHP Instead?

And for that matter, what is an Exit Do?  It is a GoTo the line after
the loop.  It may not be 
called that but that is exactly what it is.

John W. Colby
www.ColbyConsulting.com 



-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
The information contained in this transmission is intended only for the
person or entity 
to which it is addressed and may contain II-VI Proprietary and/or II-VI
Business 
Sensitive material. If you are not the intended recipient, please contact
the sender 
immediately and destroy the material in its entirety, whether electronic or
hard copy. 
You are notified that any review, retransmission, copying, disclosure,
dissemination, 
or other use of, or taking of any action in reliance upon this information
by persons 
or entities other than the intended recipient is prohibited.


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list