Howdy all,
I'm wondering how Visual Basic (and probably, compilers in general) would handle a situation like this.
Say I had this:
Its kind of hard to explain. If theVariable is set to a random number (in our case, say 100) on our first call, and then DoSomething is called again, another theVariable is declared, and set to a random number. Once this has all finished, would the variables be reset to their original values once the calling has been returned? I don't really know how to explain it. I'll try and draw up a diagram of what I mean. I just want to know before I try anything.VB Code:
Dim theCounter As Long Function DoSomething() As Long Randomize Dim theVariable As Long Do Until theCounter > 12 theVariable = Rnd() * 200 DoSomething theCounter = theCounter + 1 Loop End Function
Thanks in advance,
Phreak




Reply With Quote