Solved

Basic tutorial in writing a library unit

Posted on 2002-05-20
3
188 Views
Last Modified: 2010-04-04
Although I realise this kind of question may attract flak ("Why don't you look for it yourself?"), I have, and I haven't found anything which helps me in several days of searching...

Can anyone please point me to a tutorial (or even a clear and reasonably basic example) of a user-written library unit?

I want to implement a linked list in a library unit, so that I can call a pop, push (and initialise) function in my main application (which will use the library unit) without any code for the linked list functionality being apparent in the main application source.

Any pointers (OK, bad joke) at all gratefully received.
0
Comment
Question by:shallimus
3 Comments
 
LVL 1

Accepted Solution

by:
MBo earned 50 total points
ID: 7023141
It looks rather simple.

unit UtilLib;
interface
uses SysUtils, Classes;//what you need here

const
  QQ=137;

type

  ListRec=record
    x:Integer;
    y:Integer;
  end;

  LinkList=class
  public
    constructor Create;
    procedure XYZ;
  end;

function DoSmth:Integer;

implementation

//implement code here for class and interface procedures

end;

then write
uses ...UtilLib;
in program and use consts, types and procedures from this unit
0
 
LVL 4

Expert Comment

by:max-hb
ID: 7023571
You may even have a look at the delphi help. Try the keyword "unit" in the help index and look out for "Unit - structure and syntax". This will give you links to several other ressources of information.


0
 

Author Comment

by:shallimus
ID: 7025806
Thanks.
Just seeing the framework was enough to enable me to advance my Delphi skills (meagre though they are) today.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now