Hi :)
Let's start with properties. Properties are characteristics of an object. Examples of objects? Textbox, label, form, RadioButtons, etc. Objects can also be defined through class definitions and are instantiated when called upon and used in a program.
Methods are tasks that are tied directly to an object. They occur when an action takes place upon that object. They do not exist without the presence of that object.
Sub Routines (otherwise known as Independent Sub Functions) are functions that are completely INDEPENDENT of OBJECTS. That means that they can be called from anywhere in the program. They do not have a "return value," though they can return information to the calling function via parameter passing by reference.
Functions are code blocks thay create change on some variable or object. They are not necessarily tied to an object (though all methods are functions) and usually have a "return value" that is caught and used somehow in the calling function. Most often, this return value is stored in a variable, though the function call itself can be used in a subsequent function call (example:
Dim sum as Integer = Add(getnumber() + 2) )
I hope that is a help to you -
Best wishes,
Rob
2006-10-26 17:39:17
·
answer #1
·
answered by Rob 3
·
0⤊
0⤋
A function returns a value. It typically has a parameter list (the variable(s) listed in the parentheses after the function's name). Sometimes it does an operation on a class' member variables (which are protected inside a class and are changed by Property setters and retrieved by property getters.
A subroutine is the same as a function except it doesn't return a value. It performs some kind of operation using a parameter list or the member variables, but it doesn't return a value.
A method can be either a function or a subroutine.
A property is a unit of data that's stored inside a class. It is an attribute of the class. Properties have getters and setters that allow for testing of values inputted and for conversion of values. A property get returns a value. A property set accepts a value.
There are two dichotomies in the words you needed defined, they are (in one sense) opposites of the other. A class is made up of either methods or properties. A method can be either a function or a subroutine.
I hope this helps.
2006-10-26 02:25:25
·
answer #2
·
answered by Good Times, Happy Times... 4
·
1⤊
0⤋