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

Thread: help

  1. #1
    Join Date
    Sep 2001
    Posts
    16

    help

    i want to know what is the different between private and public function or procedure?


  2. #2
    Join Date
    Jun 2001
    Location
    Sri Lanka
    Posts
    272

    Re: help

    Private or Public is the scope
    If u define a variable or Procedure or Function as private (or Dim in some cases of Variables), u can access that only within the scope u declared.
    Eg. If u declare a function in a form as private u can access that within that form only.
    If u define the same as public in a Form, u can use that with the form name eg: x = Form1.MyFunc() ' where MyFunc is a Function defined with a Public scope

    This is same for Modules

    If u r worried about Func & Procedure, The difference is Function is supposed to return a value and a procedure (Sub Routine) is to do a task only
    Srinika

    If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it

  3. #3
    Join Date
    Sep 2001
    Posts
    16

    Re: help

    Thank You


  4. #4
    Join Date
    Jun 2001
    Location
    Sri Lanka
    Posts
    272

    Re: help

    if u r satisfied with the ans Rate the answer
    If u want anything to be clarified --> ask!!
    Srinika

    If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it

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