[AccessD] Is there a preferred style

Bobby Heid bheid at appdevgrp.com
Wed Mar 23 06:05:51 CST 2005


I agree with John.  The second version can stop unnecessary comparisons
being made.

Bobby

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W. Colby
Sent: Wednesday, March 23, 2005 12:30 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Is there a preferred style


The second.  The nesting will prevent running the next tests if the first
test passes.

It is only an issue however if it is in code that runs continuously and the
time difference will add up.  Or... Where several different answers can be
happening at the same time and the last should win.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Joe Hecht
Sent: Wednesday, March 23, 2005 12:13 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Is there a preferred style


Working alone is the pits.
 
I have three tests to set the value of a text box. What is considered to be
good coding practice?
 
1.	if test one is true then
do something
            end if
 
            if test two is true then 
                        dosomething
                        else
 do something
            end if
end sub
    
 
2.	            if test one is true then
do something
            else
                        if test two is true then 
                        dosomething
                        else
 do something
            end if
            end if
end sub
 




More information about the AccessD mailing list