三个条件:
1.函数声明在implementation前面;
2.菜单Project->Add To Project将这个单元加入
3. 要在使用此函数的单元uses unit2

解决方案 »

  1.   

    在interface 下写函数的原型
    在implementation  下实现
      

  2.   


    举个例子给你吧
    unit globeunit;interface
    uses Classes,ComCtrls,SysUtils;procedure fjstring(inputdata:string;var outsz:definesz) ;implementationprocedure fjstring(inputdata:string;var outsz:definesz) ;
    var  temp :string;
         a_Stringlist :TStringList;
         i:integer;
    begin
      try
         a_Stringlist:=TStringList.Create;
         temp:=inputdata;
         if temp[length(temp)]<>'|' then temp:=temp+'|';
         i:=pos('|', temp);
         while i<>0 do begin
            a_StringList.add(copy(temp, 1, i - 1));
            temp := copy(temp, i + 1, length(temp) - i);
            i:=pos('|', temp);
         end;
         i:=a_stringlist.Count;
         setlength(outsz,i);
         for i:=low(outsz) to high(outsz) do
           begin
              outsz[i]:=a_stringlist.Strings[i];
           end;
       finally
         a_stringlist.Free;
       end;end;end.
      

  3.   

    在需调用此函数的单元文件中USES此单元
    然后就可直接使用啦
      

  4.   

    我想你是声明位置错了,函数声明在implementation(实现)前面;
      

  5.   

    我试过了,没用
    在一个程序中新增一个unit,在这个unit单元文件中写函数。
    这个unit单元是一个。pas文件。
    但是调用不了