Results 1 to 5 of 5

Thread: difference between private and public

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Location
    Minneapolis
    Posts
    28
    I'm a newbie (though I've created a couple simple apps for my company) and I'm having trouble understanding why one would use "Private" for a sub or anything else. Can somebody help me out?

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441


    Private sub or private variable?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Location
    Minneapolis
    Posts
    28
    I was referring to a procedure, but I'd also like to know why you'd use private variables.

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well uhh,

    Private variable

    [code]

    Dim intx as integer

    Say you are doing a for loop:

    [code]

    For intx=1 to 100

    [code/]

    If it was public it would retain the value. In this case, why would you need to know the value (it will be 100 when finished).


    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  5. #5
    Addicted Member overhill's Avatar
    Join Date
    Mar 2000
    Location
    KS, United States
    Posts
    181
    As far as procedures go, Private procedures can only be called within their form. If a procedure is Public, you can call it from any form in the whole project.

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