Visual Basic Customization
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
*Adesu
What different Sub, Public, Private and Function
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
61 Views, 4 Replies
07-03-2008 06:06 PM
I still confuse to adopted that code with added "sub" "public" "private" etc
, would you please to tell me what diffrent function.
sub test()
bla..
bla..
end sub
'--------------------
public test()
bla..
bla..
end public
'------------------
private test()
bla..
bla..
end private
'--------------
function test()
bla..
bla..
end function
'---------------
public sub test()
bla..
bla..
end public
, would you please to tell me what diffrent function.
sub test()
bla..
bla..
end sub
'--------------------
public test()
bla..
bla..
end public
'------------------
private test()
bla..
bla..
end private
'--------------
function test()
bla..
bla..
end function
'---------------
public sub test()
bla..
bla..
end public
Re: What different Sub, Public, Private and Function
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-05-2008 07:59 AM in reply to:
*Adesu
highlight 'private' in vbaide.
public lets your subroutine or function be available for use by other modules
private 'Indicates that the Sub procedure is accessible only to other procedures in the module where it is declared.'
etc
public lets your subroutine or function be available for use by other modules
private 'Indicates that the Sub procedure is accessible only to other procedures in the module where it is declared.'
etc
*Adesu
Re: What different Sub, Public, Private and Function
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-06-2008 06:15 PM in reply to:
*Adesu
thanks for you answerd, i would check again in help file.
wrote in message news:5974101@discussion.autodesk.com...
highlight 'private' in vbaide.
public lets your subroutine or function be available for use by other
modules
private 'Indicates that the Sub procedure is accessible only to other
procedures in the module where it is declared.'
etc
highlight 'private' in vbaide.
public lets your subroutine or function be available for use by other
modules
private 'Indicates that the Sub procedure is accessible only to other
procedures in the module where it is declared.'
etc
Re: What different Sub, Public, Private and Function
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-07-2008 10:49 PM in reply to:
*Adesu
Your question can be divided in following two parts
1. difference between sub and function
2. difference between private and public
Sub procedures doesn't return a value while by using functions you can get the returned value e.g.
Public function XX(byval YY) as string
End function
Private functions or sub can be used within a single module where they are defined while public procedures can be call from anywhere within the project.
Hope I make the thing clear to you.
Kaushal
1. difference between sub and function
2. difference between private and public
Sub procedures doesn't return a value while by using functions you can get the returned value e.g.
Public function XX(byval YY) as string
End function
Private functions or sub can be used within a single module where they are defined while public procedures can be call from anywhere within the project.
Hope I make the thing clear to you.
Kaushal
*Adesu
Re: What different Sub, Public, Private and Function
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-07-2008 11:51 PM in reply to:
*Adesu
it's good info, I got it.
thanks.
wrote in message news:5975553@discussion.autodesk.com...
Your question can be divided in following two parts
1. difference between sub and function
2. difference between private and public
Sub procedures doesn't return a value while by using functions you can get
the returned value e.g.
Public function XX(byval YY) as string
End function
Private functions or sub can be used within a single module where they are
defined while public procedures can be call from anywhere within the
project.
Hope I make the thing clear to you.
Kaushal
thanks.
Your question can be divided in following two parts
1. difference between sub and function
2. difference between private and public
Sub procedures doesn't return a value while by using functions you can get
the returned value e.g.
Public function XX(byval YY) as string
End function
Private functions or sub can be used within a single module where they are
defined while public procedures can be call from anywhere within the
project.
Hope I make the thing clear to you.
Kaushal
