answersLogoWhite

0

A Delphi unit is a separate file used to store procedures and functions. If you know what a form is, a unit is exactly the same, except it has no visual interface. So you can't put windows controls on it like buttons and edit boxes. A form has windows controls and their associated code behind them, a unit only has the code.

They are useful if you have some functions that you use often from many different forms and you only want to write them once. For example:

function LeftStr(const S : String; Index : Integer) : String;

begin

If Index <= 0

then

Result := ''

else

Result := Copy(S, 1, Index);

end;

function RightStr(const S : String; Index : Integer) : String;

begin

If Index > Length(S)

then

Result := ''

else

Result := Copy(S, Index, (Length(S)-Index+1));

end;

Then you can have your unit's name in a forms uses clause and then use the functions LeftStr and RightStr from several different forms.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Is a Delphi unit displayed at runtime?

A Delphi unit is a code module. Delphi code modules are compiled to machine code and therefore do not exist at runtime. They are a programming aid, nothing more.


What is a Delphi?

Delphi is a programming language :)


Where is the Delphi Public Library in Delphi located?

The address of the Delphi Public Library is: 222 East Main Street, Delphi, 46923 1593


When was Delphi Funds created?

Delphi Funds was created in 1995.


Where was ancient Delphi located in Greece?

Delphi


Where is the Delphi Preservation Society Inc in Delphi Indiana located?

The address of the Delphi Preservation Society Inc is: Po Box 161, Delphi, IN 46923-0161


What is the function of the Delphi electronic unit inside the air cleaner box of a 2002 Buick Regal?

I believe the unit inside the air cleaner assembly is the ecm. Electronic control module/ car's computer.


What XM radio will fit in the dash of a 2000 Neon?

Delphi XpressRC Receiver & Car Kit is the best unit to get for a 2000 Neon with a cost of $124.99.


Where can one learn about Delphi Programming?

It is relatively simple for one to learn about Delphi programming. In order to learn about Delphi programming, one can visit the About website and view the page on Delphi programming.


What is the phone number of the Delphi Public Library in Delphi?

The phone number of the Delphi Public Library is: 765-564-2929.


How tall is Delphi Lythgoe?

Delphi Lythgoe is 5' 8".


When was The Charioteer of Delphi created?

The Charioteer of Delphi was created in 2006.