Passing multidimensional array to procedure of function?

I've hit the "code segment too large" wall in my main unit, but I've already moved all the procedures I can into other units. The remaining procedures all need to access the variables contained within a rather large multidimensional array. How do I pass this array to another unit, so I can move these procedures to another unit?

Comments

  • : I've hit the "code segment too large" wall in my main unit, but I've already moved all the procedures I can into other units. The remaining procedures all need to access the variables contained within a rather large multidimensional array. How do I pass this array to another unit, so I can move these procedures to another unit?
    :
    All variables, which are declared in the interface part of the unit are accessible by all units which use that unit. Example:
    [code]
    unit Unit1;
    interface

    var
    SomeInt: integer;

    implementation

    end.
    [/code]

    [code]
    unit Unit2;
    interface

    implementation

    uses
    Unit1;

    procedure Add1;
    begin
    SomeInt := SomeInt + 1;
    end;

    end.
    [/code]
  • : : I've hit the "code segment too large" wall in my main unit, but I've already moved all the procedures I can into other units. The remaining procedures all need to access the variables contained within a rather large multidimensional array. How do I pass this array to another unit, so I can move these procedures to another unit?
    : :
    : All variables, which are declared in the interface part of the unit are accessible by all units which use that unit. Example:
    : [code]
    : unit Unit1;
    : interface
    :
    : var
    : SomeInt: integer;
    :
    : implementation
    :
    : end.
    : [/code]
    :
    : [code]
    : unit Unit2;
    : interface
    :
    : implementation
    :
    : uses
    : Unit1;
    :
    : procedure Add1;
    : begin
    : SomeInt := SomeInt + 1;
    : end;
    :
    : end.
    : [/code]
    :

    That I did not know! But it sure made my programming a whole lot easier. Thanks a lot! :o)
Sign In or Register to comment.

Howdy, Stranger!

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

Categories