Results 1 to 4 of 4

Thread: [RESOLVED] Initializing variables

  1. #1

    Thread Starter
    Member Mad_Max's Avatar
    Join Date
    Dec 2005
    Location
    Kingston, Ontario, Canada
    Posts
    33

    Resolved [RESOLVED] Initializing variables

    Hi,

    Is it safe to assume that variables (integers, boolean, singles) which are declared in a form's General Declarations section will always be initialized on a form's Load event?
    How about if the form was loaded, unloaded and then loaded again? Will those variables in the GD section be initializiled by virtue of the fact that the form was unloaded?
    It's always been my assumption that this was the case; am I incorrect?

    Thanks,

    Chris
    Last edited by Hack; Mar 30th, 2006 at 01:15 PM.

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Initializing variables

    Yes, all generally declared variable will be initialized on the load event.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3

    Thread Starter
    Member Mad_Max's Avatar
    Join Date
    Dec 2005
    Location
    Kingston, Ontario, Canada
    Posts
    33

    Re: Initializing variables

    This may sound like a very "basic" question, but how can I check which forms are loaded or unloaded while the project is running?

    Thanks again.

    Chris

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Initializing variables

    Quote Originally Posted by Mad_Max
    This may sound like a very "basic" question, but how can I check which forms are loaded or unloaded while the project is running?

    Thanks again.

    Chris
    You can't tell what are NOT loaded, but you can tell which ARE loaded by using something like
    VB Code:
    1. Dim frm As Form
    2.  For Each frm In Forms
    3.      MsgBox frm.Name
    4.  Next
    For a large project, a msgbox would be impractical so that would be substituted with something more realistic. However, this code will ONLY display the names of the forms that ARE currently loaded.

Posting Permissions

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



Click Here to Expand Forum to Full Width