Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Basic tutorial in writing a library unit

Posted on 2002-05-20
3
190 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

807 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