Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2002
    Location
    Hamilton,Ontario
    Posts
    132

    Question Unanswered: Destroying Variables

    Hi All:
    I was wondering is there any way that I can destory created variables once exiting the system. and how Global variables behave .
    This situation is i have
    Global ID as Long
    and when the new ID is generated this ID doesnt read the new value. im sure something is wron in the code, but just to gain more speed adn reduce memory leaks i was wondering if i can create and destroy variable at run time.
    thanx in advance.
    vbaProgrmmer

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820

    Re: Destroying Variables

    Originally posted by VBAPROGRAMMER
    Hi All:
    I was wondering is there any way that I can destory created variables once exiting the system. and how Global variables behave .
    This situation is i have
    Global ID as Long
    and when the new ID is generated this ID doesnt read the new value. im sure something is wron in the code, but just to gain more speed adn reduce memory leaks i was wondering if i can create and destroy variable at run time.
    thanx in advance.
    vbaProgrmmer
    VB should Destroy the variables it's self after once the variable are no longer in use, if you want to send me the code i'll take a look at it (if i get the chance) and see if i can spot your problem
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    back in a95 (last rev for which i have full documentation), all global modules are loaded into memory at startup -- and they stay there until the application exits.

    maybe this all-load-at-startup behaviour changed with later revs, but by it's very nature, a global module MUST stay in memory once any part of it is referenced.

    so: once you assign a value to a global var it stays there until you change the value or the application exits. i can't see how you could "unDim" a global.

    ?? can it be that you have a local var of the same name as your global.........

    izy

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    another thought (red wine helps!)

    you can fake a global var using a public var on a hidden form: killing the form kills your "global".

    izy

Posting Permissions

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