answersLogoWhite

0

What is a Delphi unit?

Updated: 12/19/2022
User Avatar

Wiki User

12y ago

Best Answer

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

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a Delphi unit?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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


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.


How tall is Delphi Lythgoe?

Delphi Lythgoe is 5' 8".


When did Timasitheus of Delphi die?

Timasitheus of Delphi died in 508.


When did The Delphi Bureau end?

The Delphi Bureau ended in 1973.


When was Delphi I created?

Delphi I was created on 27-10-26.


When was Delphi Glass created?

Delphi Glass was created in 1972.


What is Delphi Automotive's population?

The population of Delphi Automotive is 146,600.