Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    destried var... (6.0)

    assuming i use this var MY_VAR and during the code run assume the value MY_VAR="xxyy" for the next use with a blank value is correct My_VAR="" or existis other method?

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: destried var... (6.0)

    Sal,

    This completely depends on what kind of variable MY_VAR is, and how you use it.

    When you next go to use MY_VAR are you checking its value? Can we see the line of code that does this.

    StuartR

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: destried var... (6.0)

    I don't use VB, only VBA, but this might be similar.

    It is a good practice to reset any variables where you depend on a starting value:

    myInteger = 0
    myString = ""

    Although values might not carry over, why take a chance?

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: destried var... (6.0)

    and of course...

    Set MyObject = Nothing

    StuartR

Posting Permissions

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