assuming a single file is called "file1.extension" and its contents:
function Add(a,b:integer):integer; begin result:=a+b; end;
and another file called "main.extension" with content:
var a,b,c:integer; a:=1; b:=2; c:=Add(a,b); println(inttoStr(c));
you need to add the following line at the beginning of main.extension:
// note that file name is case sensitive // file1.extension <> FILE1.EXTENSION // include_once is to solve cycle-includes // ie file1.extension includes main.extension and vice-versa {$include_once 'file1.extension'} // or include if file1.extension does not require functions/objects/variables/etc. // from main.extension {$include 'file1.extension'}
I suggest using {$ include_once ...} instead of {$ include ...}.
source share