The Artima Developer Community
Sponsored Link

.NET Buzz Forum
VB's OrElse (AndAlso) revisited

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Steve Hebert

Posts: 218
Nickname: sdhebert
Registered: Apr, 2005

Steve Hebert is a .NET developer who has created the .Math compiler library.
VB's OrElse (AndAlso) revisited Posted: Apr 25, 2006 11:33 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Steve Hebert.
Original Post: VB's OrElse (AndAlso) revisited
Feed Title: Steve Hebert's Development Blog
Feed URL: /error.htm?aspxerrorpath=/blogs/steve.hebert/rss.aspx
Feed Description: .Steve's .Blog - Including .Net, SQL Server, .Math and everything in between
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Steve Hebert
Latest Posts From Steve Hebert's Development Blog

Advertisement
After reading Billy Hollis' explanation of Visual Basic's OrElse and AndAlso statements,  I think it actually made me think less of VB. 

I vaguely remember studying these for the Microsoft VB5 certification test 8 or 9 years ago.  This is why the following statement doesn't short circuit and causes a runtime error if Value[index] == null:

if Value[index] Is Not Null and Value[index] = "1" then ...

Instead you have to write it as:

if Value[index] Is Not Null AndAlso Value[Index] = "1" then...

AndAlso??? AndAlso!?!? How could you implement those keywords without laughing the entire time you're doing it?





Share this post: Email it! | bookmark it! | digg it! | reddit!

Read: VB's OrElse (AndAlso) revisited

Topic: Evolution of WCM in MOSS 2007 - Webcast recording Previous Topic   Next Topic Topic: Service Oriented Reuse

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use