VBScript Brain Teaser

Posted on

Okay, here’s a “fun” little brain teaser to test how well you understand VBScript. This first code snippet behaves exactly as you would expect: Z() defines a global variable, and this variable remains visible after the function returns:

This next code snippet introduces a minor variation, but now the last line produces an error: […]