What's the defrrence between these(sub,procedure,function,private) !!??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What's the defrrence between these(sub,procedure,function,private)
and when i use them
Als
i know it can be function ,sub or procedure Public or private so what does it mean Private only such as
Private ask(
.......
statmen
........
End private
 
ifrst said:
What's the defrrence between these(sub,procedure,function,private)
and when i use them
Also
i know it can be function ,sub or procedure Public or private so what
does it mean Private only such as : Private ask()
.......
statment
........
End private

What about reading the VB.NET documentation?
 
* "=?Utf-8?B?aWZyc3Q=?= said:
What's the defrrence between these(sub,procedure,function,private)
and when i use them
Also
i know it can be function ,sub or procedure Public or private so what does it mean Private only such as :
Private ask()
.......
statment
........
End private

Quick and dirty:

A procedure is a collection of commands which will be executed.

As sub is a procedure without return value.

A function is a procedure which returns a value.

'Private' will restrict access to the procedure within the same class
only.
 
i know it can be function ,sub or procedure Public or private so what does it mean Private only such as :
Private ask()
.......
statment
........
End private


That's not valid code, so it means you'll get a compile error. ;-)



Mattias
 
Major ACK - Dont you just get sick of this type of question ?, I do !

OHM
 
One Handed Man said:
Major ACK - Dont you just get sick of this type of question ?, I do
!

I rarely ask this question - but if, it's the simplest answer. ;-)
 
Hi, if you've looked at code, and seen Private only, then you will have seen
a module-level variable declaration, there is no block syntax for private...
Private...End Private, it doesn't exist.

Private m_Var As String

This will declare a variable at the module-level, that's available only to
the class that it is declared in:

Public Class [MyClass]
Private m_Var As String

Public Sub Foobar()
MsgBox(m_Var)
End Sub
End Class

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
 
H Ifirst

Almost everybody regular and even more in this newsgroup have answered you

And therefore I do it also, with all your questions in a sample the
description you have from Herfried

I hope this helps?

Cor
\\\\
Public Sub ask()
messagebox.show(Answer("Ifirst"))
End sub
Private function Answer(byval question as string) as string
If question = "Ifirst" then return "It is Ifirst"
End function
////
 
Back
Top