Solved

Basic tutorial in writing a library unit

Posted on 2002-05-20
3
187 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks.
Just seeing the framework was enough to enable me to advance my Delphi skills (meagre though they are) today.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

771 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

12 Experts available now in Live!

Get 1:1 Help Now