Writing DLLs in Delphi

The Different Ways of Passing Information

First of all I will go back to basics. There are two ways that variables can be shared between procedures, functions or subprograms:

In VB, the default setting is that all variables are passed by reference. This means any variable that is altered within a subroutine or function is also altered externally from the subroutine or function.

Delphi is the exact opposite, where all variables are passed by value. To make Delphi pass by reference use the var keyword.

The key thing to understand is, if you want to retrieve information from a Delphi procedure or function, the variable must be proceeded with var. If you want more information on VB and ByVal and ByRef see Chapter 3 in Dan Appleman's book "VB Programmers Guide to the Windows API".


Image of arrow to previous article Image of arrow to next article

Image of line
[HOME] [TABLE OF CONTENTS] [SEARCH]