CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: class modules

  1. #1
    Join Date
    Apr 2001
    Posts
    17

    class modules

    I have a class module and a bas. module but program is not reading global variables in class module. is there a compatability problem with having two different modules. if not, what could be the problem. if yoou need code i'll send it.


  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: class modules

    How are you accessing the variable? Anyhow consider the following:

    1. New Project w/ Form1 and Class1
    2. In Class1 code:

    option explicit

    public bUseDebug as Boolean




    3. In Form1 code

    private sub Form_Load()
    dim oClass as new Class1
    debug.print "Debug Flag Before: " & oClass.bUseDebug
    oClass.bUseDebug = true
    debug.print "Debug Flag After: " & oClass.bUseDebug
    end sub




    When you run the code you should see FALSE and TRUE printed out in the Immediate Window.

    Hope it helps,
    -Cool Bizs

    Good Luck,
    -Cool Bizs

  3. #3
    Join Date
    Apr 2001
    Posts
    17

    Re: class modules

    all variables were global,but upon a much closer look, something buried deep got switched around in shuffle and needed changed. however i saved your suggestion for future use thank you.


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

Featured