Posts Shooting down more Anti-VB'isms...
Post
Cancel

Shooting down more Anti-VB'isms...

This guy states:

“I just can't LIVE without being able to do things like:“

<FONT color=#0000ff>string </FONT>oink = myHashTable[someKey] <FONT color=#0000ff>as string</FONT>;
<FONT color=#0000ff>if</FONT>(oink != <FONT color=#0000ff>null</FONT>)

“Or“

<FONT color=#0000ff>lock</FONT>(<FONT color=#0000ff>this</FONT>) {
  <FONT color=#008000>// yada yada yada
</FONT>}

Hmmm... let's see.  He states that VB can't do the above by stating that he “just can't LIVE without being able to do”.  Let me write the above items in VB...

<FONT color=#0000ff>Dim</FONT> oink <FONT color=#0000ff>As</FONT> <FONT color=#0000ff>String</FONT> = <FONT color=#0000ff>TryCast</FONT>(myHashTable(someKey), String)
<FONT color=#0000ff>If</FONT> oink <FONT color=#0000ff>IsNot Nothing Then
</FONT>
Or

<FONT color=#0000ff>SyncLock Me
</FONT>  <FONT color=#008000>' yada yada yada
</FONT><FONT color=#0000ff>End SyncLock</FONT>

<FONT color=#000000>Hmm... looks like you *CAN DO* these...</FONT>

This post is licensed under CC BY 4.0 by the author.