Solved

Basic tutorial in writing a library unit

Posted on 2002-05-20
3
192 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
[X]
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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Firemonkey android show image from resource ? 1 73
Dev express lookupcombo 3 64
DBCtrlGrid, Delphi, Scroll 8 87
Browsing a TTreeView in Delphi 5 49
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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