IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesC++  Print This     

Custom Routines (C++ and Access VBA Cross Reference Guide)

By Mike Prestwood

C++ versus Access VBA: A side by side comparison between C++ and Access VBA.

 
Language Details
 

Language Details is kind of a catch all for stuff that didn't make it into language basics nor any other category.

Custom Routines

[Other Languages] 

Languages Focus

For non-OOP languages, a custom routine is a function, procedure, or subroutine and for pure OOP languages, a custom routine is a class method. Hybrid languages (both non-OOP and OOP) combine both.

C++: 

C++ is a hybrid language and as such offers global functions and class methods. A function must come before it's usage or you can prototype the function.

Syntax Example:
void sayHello(string pName) {
cout << "Hello " + pName + "\n";
};
 
int add(int p1, int p2) {
int result;
 
  result = p1 + p2;
return result;
};
Access VBA:   Sub, Function

Access VBA is a non-OOP language with some OOP features. It offers both Subs and Functions. A Sub does not return a value while a Function does. When Subs and Functions are used in a class module, they become the methods of the class.

Syntax Example:
Sub SayHello(ByVal pName As String)
  MsgBox ("Hello " & pName)
End Sub
 
Function Add(pN1 As Integer, pN2 As Integer) As Integer
  Add = pN1 + pN2
End Function












Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2025 Prestwood IT Solutions.   [Security & Privacy]