• Markus (unregistered)

    The question that really counts... what code called HoldIt?

  • (nodebb)

    I think Fred Blogs and Duffy should get a room.

  • Random Guest (unregistered)

    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.

  • J. Random PMP (unregistered)

    "Duff" is also British slang meaning "worthless, inferior, or just plain crappy."

  • Gearhead (unregistered)

    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.

  • Zatapatique (unregistered)

    I'm broken. This isn't the frist time.

  • Drak (unregistered) in reply to Gearhead
    Comment held for moderation.
  • WTFGuy (unregistered)
    Comment held for moderation.
  • (nodebb) in reply to Gearhead

    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.

Leave a comment on “The Duff Code”

Log In or post as a guest

Replying to comment #:

« Return to Article