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++/CLI  Print This     

Custom Routines (C++/CLI and Delphi Prism Cross Reference Guide)

By Mike Prestwood

C++/CLI versus Delphi Prism: A side by side comparison between C++/CLI and Delphi Prism.

 
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.

[Not specified yet. Coming...]
Delphi Prism:   method, procedure, function

In Prism, everything is within a class (just like with C#, VB.Net, and Java). So you create class methods using the method keyword. Alternatively, you can use procedure or function if you want the compiler to enforce returning or not returning a value.

[function/procedure] RoutineName : ReturnType; 

As with C++, your custom routine must come before it's first usage or you have to prototype it in the Interface section.

Syntax Example:
method Form1.IntroduceYourself;
begin
  MessageBox.Show("Hello, I do not have a name yet.");
end;

procedure Form1.SayHello(pName: String);
begin
  MessageBox.Show("Hello " + pName);
end;
 
function Form1.Add(p1, p2 : Double): Double;
begin
  Result := p1 + p2;
end;












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


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