Re: Coding style
- From: "Marina Levit [MVP]" <someone@xxxxxxxxxx>
- Date: Fri, 21 Jul 2006 12:48:47 -0400
I would prefer #2 with a twist:
Me.CheckBoxPrimaryYN.Enabled = Me.CheckBoxPrimaryYN.Checked or
dr.PrimarySet <> 1
or if you prefer the other condition for clarity, then:
Me.CheckBoxPrimaryYN.Enabled = Not (Not Me.CheckBoxPrimaryYN.Checked And
dr.PrimarySet = 1)
"Sergey Zuyev" <SergeyZuyev@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FBCFC5BE-9706-4BFB-A6BC-2D5A95B54B0F@xxxxxxxxxxxxxxxx
Hello All
I work at software company and we are having a really big discussion
about
coding styles and it seems that more people
prefer statement 1 to statement2 , which was a big surprise to me. Please
help us with your comments. Thanks
Which way is better way 1 or 2?
1. 'set enable status on CheckboxPrimaryYN
If (Me.CheckBoxPrimaryYN.Checked = True) And (dr.PrimarySet > 0)
Then
Me.CheckBoxPrimaryYN.Enabled = True
Else
If (Me.CheckBoxPrimaryYN.Checked = False) Then
If (dr.PrimarySet = 0) Then
Me.CheckBoxPrimaryYN.Enabled = True
Else
Me.CheckBoxPrimaryYN.Enabled = False
End If
End If
End If
2. 'set enable status on CheckboxPrimaryYN
Me.CheckBoxPrimaryYN.Enabled = Not (Me.CheckBoxPrimaryYN.Checked =
False And dr.PrimarySet = 1)
--
Programmer
.
- Prev by Date: Not first class in file
- Next by Date: Re: Coding style
- Previous by thread: Re: Coding style
- Next by thread: Re: Coding style
- Index(es):