What is considered the best way to check to see if a routine (subroutine, function whatever) has been called before (check to see if the current call is the first time)?
Of course there are many ways to do this...
Can add a global variable, set it to something like -1 and in the routine check on that value and then immediately set it to something other than -1. If it's -1 coming in it's the first time. Problem here is you need to add a global (or form level) variable.
Can add a static variable and check for initial value (0 usually). Problem here is you are relying on VB setting initial values to be what you expect. Look at .NET everything changes!
Is there a better way?
Enter your message below
Sign in or Join us (it's free).