Results 1 to 2 of 2

Thread: how to make a library and use it?

  1. #1

    how to make a library and use it?

    After downloading a tried a hello world and that worked. Next i tried to extend it and make hello world from library out of it. But i cannot get it to work.
    How do i write a unit and how do i use it from the main program.
    Next how do i make a .dll out of that unit and use it from the main program.
    All i get is that an identifier is not existing.
    Also should i use namespace or unit/method or procedure?
    Thanks for your answers in advance.
    http://3das.noeska.com - create adventure games without programming

  2. #2

    Re: how to make a library and use it?

    I managed it:

    Code:
    unit HelloLib;
    
    interface
    
    type
     MyClass = public static class
     public
      class procedure Test;
     end;
    
    implementation
    
    procedure MyClass.Test();
    begin
     Console.WriteLine('Hello World From Lib.');
    end;
    
    end.
    Code:
    unit HelloWorld;
    
    interface
    
    uses HelloLib;
    
    implementation
    
    procedure Main;
    begin
     Console.WriteLine('Hello World.');
     MyClass.Test();
    end;
    
    end.

    Oxygene HelloLib.pas /assemblyname:HelloLib /type:library /frameworkfolder:C:\WINDOWS\Microsoft.NET\FrameWork \v2.0.50727
    Oxygene Hello.pas /assemblyname:HelloWorld /frameworkfolder:C:\WINDOWS\Microsoft.NET\FrameWork \v2.0.50727 /ref:HelloLib.dll
    http://3das.noeska.com - create adventure games without programming

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •