Results 1 to 3 of 3

Thread: Variables

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Posts
    229

    Variables

    Hi, I have project that is made of multiple Class Modules or Objects. Well, I would like a variable within the Object to be accessible by the program that declares the object.

    ~~~~~~~~~~~~~~~
    ~~OBJECT PROJECT~~
    ~~~~~~~~~~~~~~~
    VARIABLE1 ~
    ~~~~~~~~~~~~~~~


    ~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~FORM PROJECT~~~~~~~
    ~~~~~~~~~~~~~~~~~~~~~~~
    Dim ObjProj As New ObjectProject ~
    MSGBOX VARIABLE1 ~
    ~~~~~~~~~~~~~~~~~~~~~~~

  2. #2
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: Variables

    This is the only way:

    ~~~~~~~~~~~~~~~
    ~~OBJECT PROJECT~~
    ~~~~~~~~~~~~~~~
    VB Code:
    1. Option Explicit
    2.  
    3. Public Variable As String

    ~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~FORM PROJECT~~~~~~~
    ~~~~~~~~~~~~~~~~~~~~~~~
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     Dim MyObj As Class1
    5.    
    6.     Set MyObj = New Class1
    7.    
    8.     MsgBox MyObj.Variable
    9.  
    10. End Sub
    ~~~~~~~~~~~~~~~~~~~~~~~
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I was about to write that but Mc. always faster

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