| « Prev | Page 1 | Next » |
|
confusion is the key!
|
re: objDocument.SetDocumentIndex = "WTF"
2004-08-03 04:40
•
by
Paul Hill
|
|
I love the way they eat *any* exception, rather than what .FindByValue returns. Mmmm.... silently failing code....
|
|
To get the most out of this blog it seems working knowledge of VB and SQL are really needed.
I have also realized that I never want to use VB or SQL, ever. |
|
Since this guy broke the mold I figure I can finally implement this code:
Public Function IsIntBob(value as Integer) as Boolean If ctype(ctype(value, Double), String) = "Bob" Then Return True Else Return False End if End Function |
re: objDocument.SetDocumentIndex = "WTF"
2004-08-03 12:39
•
by
Alex Papadimoulis
|
|
Tony, that is hysterical.
|
re: objDocument.SetDocumentIndex = "WTF"
2004-08-03 13:40
•
by
(Anonymous)
|
|
But Tony, shouldn't you surround that with a Try…Catch, just in case there's an InvalidCastException?
|
|
If you would like to see more examples, just let me know. I've spent months replacing code like this from this particular colleague and since I use source control, I can always go back into history and find some code for a good laugh now and then.
|
re: objDocument.SetDocumentIndex = "WTF"
2004-08-03 15:49
•
by
Eric Newton
|
|
Hey, I wonder if a few lines down, we see:
Public Readonly Property GetDocumentIndex() as Int32 Get return ddlDocument.SelectedIndex End Get End Property |
|
Oh thats nothing. How about this?
Public ReadOnly Property GetProduction(ByVal vType As eProductionType) As String Get Dim oDataView As DataView Select Case vType Case eProductionType.Projected Return FormatOrderAmount(SelectedGroup.ProjectedProduction) Case eProductionType.OnHold Return FormatOrderAmount(SelectedGroup.OnHoldOrderTotal) Case eProductionType.Potential Return FormatOrderAmount(SelectedGroup.PotentialProduction) End Select End Get End Property A parameterized read only property named with a Get prefix! I'm at a loss for words. |
|
I like to call the above pattern an "Propenumtion". It use an enum and a paramterized property that to all others looks like a function.
|
| « Prev | Page 1 | Next » |