Board index » delphi » Help on creating/editing/compiling units (libraries?)

Help on creating/editing/compiling units (libraries?)

Hi,
        Can anyone point me to a reference for turbo pascal 6.0 that
would tell me how to make my own units for it - yeah, you guessed it -
mine is  a second hand copy of TP6, which I bought from a student with
no manuals - original disks though!

Any help would be appreciated.

TIA
        Shane.

 

Re:Help on creating/editing/compiling units (libraries?)


Hello,

Quote
>Hi,
>    Can anyone point me to a reference for turbo pascal 6.0 that
>would tell me how to make my own units for it - yeah, you guessed it -
>mine is  a second hand copy of TP6, which I bought from a student with
>no manuals - original disks though!

Try looking up 'unit' in the online help...

Anyway, it goes like this:

unit blah;

interface

function foo(a, b : integer) : integer;

implementation

function foo(a, b : integer) : integer;
   begin
      foo := a+b;
   end;  {foo}

begin                                    {these two lines }
   writeln('Initialising blah...');  {are not necessary }
end.                                      {but this is }

Then just make sure you're compiling to disk, and do it.  You might
also need to check which directories tp looks in to find units (under
options, directories) when you actually come to use the unit.

cu...

--
  Michael Langton <*langt...@manawatu.gen.nz>

Other Threads