Solved

Basic tutorial in writing a library unit

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

762 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