Thursday, June 25, 2009

VBScript Function IsArrayValid()

I see a lot of people still stuck in VBS-land that are frustrated by the lack of array handling functions. One of the biggest questions is how to deal with uninitialized dynamic arrays. You can't depend on ubound() = 0 because by default VBS arrays are zero-based and if you try to do a ubound() on an array that hasn't been Dim/Redim-ed it will throw an error. IsArray() returns true and isNull() or isEmpty() return false regardless of whether the array has been initialized or not. For anyone who's interested I put together this very simple function you can use to deal with it. Like it, use it, or don't - it's up to you.

Function isArrayValid(varArray)
Dim varResult
Dim intTemp

varResult = False
intTemp = -1

On Error Resume Next
intTemp = ubound(varArray)
On Error Goto 0

If intTemp > -1 then
varResult = True
End If

isArrayValid = varResult
End Function

Best Buy Palm Pre Case

iPod sold separately. I love it!

Monday, June 08, 2009

iJustine's Palm Pre Purchase Paradox

Leo Drops the F-Bomb On Mike Arrington

Could this kick any more ass? Leo Laporte gets pissed. I love it. GO LEO!

Thursday, June 04, 2009

Han Solo, P.I.

The Tonight Show Twitter Tracker

You just can't beat that tweet.

Wednesday, June 03, 2009

Leo's Evil Exercise Ball Has It's Revenge

If you like Leo, watch this video. If you don't like Leo, watch this video.