Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

OO - Large Classes

szluhaszluha Member Posts: 29 ✭✭
How can I place each function of a class in its own unit? I have a very large class TAccount_Manager with many functions, some of which are very long. I would like to place some of the functions of this class in its own unit so that its easier to manage, but still want access to the classes private declarations.

Comments

  • zibadianzibadian Member Posts: 6,349
    : How can I place each function of a class in its own unit? I have a
    : very large class TAccount_Manager with many functions, some of which
    : are very long. I would like to place some of the functions of this
    : class in its own unit so that its easier to manage, but still want
    : access to the classes private declarations.

    That's not possible. It is however possible to break a unit into smaller files by using include files. Here's a simple example:
    [code]
    program IncludeHelloWorld;

    begin
    {$I 'helloworld.inc'}
    end.
    [/code]
    helloworld.inc:
    [code]
    writeln('Hello world!');
    [/code]
    The compiler replaces the {$I} directive with the specified file.
  • szluhaszluha Member Posts: 29 ✭✭
    Thanks zibadian, thats exactly what I want to do.
Sign In or Register to comment.