Rob Eberhardt

cleverness ensues

skip navigation

 Monday, May 29, 2006

5/29/2006 12:44 PM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

 Thursday, May 25, 2006

I add a custom IIF function to every VBscript I make:

' IIF recreated for VBscript
FUNCTION IIF(Expression, Truepart, Falsepart)
	IF Expression THEN 
		IIF = Truepart
	ELSE
		IIF = Falsepart
	END IF
END FUNCTION

'used like so:
strFlavor = IIF(strColor="brown", "chocolate", "not chocolate")

Mind you, it evaluates all parameters on the way in, so even though this checks the objTest object when assigning using it, it would still fail (when the objTest object reference is not set):

strFlavor = IIF(IsObject(objTest), objTest.flavor, "vanilla")

It's no ternary operator, but it's still indispensible for efficient VBScript coding.

5/25/2006 6:21 PM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

 Sunday, May 21, 2006

Guess I'm not the only one who was baffled by the new W3C XMLHTTPRequest spec credits.

From Dare Obasanjo:

Interesting. A W3C specification that documents a proprietary Microsoft API which not only does not include a Microsoft employee as a spec author but doesn't even reference any of the IXMLHttpRequest documentation on MSDN. I'm sure there's a lesson in there somewhere. ;)

And then finally from Anne van Kesteren (one of the spec's authors):

Hereby my apologies to everyone who had to waste his time by writing a rant... The current draft reads: "Special thanks also to the Microsoft employees who first implemented the XMLHttpRequest interface, which was first widely deployed by the Windows Internet Explorer browser."

5/21/2006 12:47 AM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  |