+ Reply to Thread
Results 1 to 3 of 3

Counter reset

  1. #1
    Registered User
    Join Date
    06-13-2006
    Posts
    14

    Counter reset

    Does a counter variable get reset automatically when the sub is exited? I wanted to use an If statement to call out another sub rutine that counts based on other criteria, however; this will not work if the counter is automatically reset when that sub is exited.

    Thanks in Advance for your help.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello BN-CD,

    The counter variable will be set to its default when your Sub or Function procedure is started. The default depends of the variable type. Once the procedure exits, the variables are destroyed. This only applies only to variables that are not declared as Public or Static.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    06-13-2006
    Posts
    14
    Thanks for the info! Its much appriciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1