- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
The question that really counts... what code called HoldIt?
Admin
I think Fred Blogs and Duffy should get a room.
Admin
The delay doesn't work - well, not always. The VBA Second function returns the number of seconds into the current minute (i.e. 0-59). Consider if the function is called with a delay of 10 and the current seconds (i.e. past the minute) is 55. Temp will be set to 1, then 2, then 3, then 4, then -55, then -54,... That's never going to be more than 10. That's not even considering that this is a spin loop that's going to consume 100% CPU.
Admin
"Duff" is also British slang meaning "worthless, inferior, or just plain crappy."
Admin
If I read this correctly, Count is a local variable. Since it is not initialized, its value is Empty, and Empty + 1 is Empty. Empty gets coerced to 0 in the comparison operator and we always get the first branch.
Admin
I'm broken. This isn't the frist time.
Admin
No, Empty + 1 is 1.
The reference page for the + operator states that if one argument is an empty variant and the other argument is not a variant, the non-variant argument is returned as the result. This isn't too surprising since Empty is represented as 0 in numeric context.