LIST.PAS
T2_2.PASLIST.PAS是对线性表的描述
unit list;
interface
   const
      maxlen=1000;
      NULL=0;
   type LinearList=record
                   elem:array[1..maxlen]of integer;
                   last:0..maxlen
                 end;   procedure Initiate(var l:LinearList);
   function Length(var l:LinearList):integer;
   function Get(var l:LinearList;i:integer):integer;
   function Prior(var l:LinearList;ele:integer):integer;
   function Next(var l:LinearList;ele:integer):integer;
   function Locate(var l:LinearList;x:integer):integer;
   procedure Insert(var l:LinearList;i,b:integer);
   procedure Delete(var l:LinearList;i:integer);
   function Empty(var l:LinearList):boolean;
   procedure Clear(var l:LinearList);
   procedure union(var la,lb:LinearList);
   procedure merge_list(la,lb:LinearList;var lc:LinearList);
   procedure Print(la:LinearList);
implementation
。。下面的省略T2_2.PAS如下:
program t2_2(input,output);
uses list;
var
   a,b,c:linearlist;
   la,lb,lc,i,t,j:integer;
begin
   Initiate(a);
   Initiate(b);
   writeln;
   writeln('How many elements in array A?');
   readln(la);
   writeln('Please input the elements:');
   for i:=1 to la do
   begin
      read(t);
      Insert(a,i,t);
   end;
   writeln('How many elements in array B?');
   readln(lb);
   writeln('Please input the elements:');
   for i:=1 to lb do
   begin
      read(t);
      Insert(b,i,t);
   end;
   for i:=1 to la-1 do
      for j:=i+1 to la do
      begin
         if get(a,i)>get(a,j) then
         begin
            Insert(a,i,get(a,j));
            Insert(a,j+1,get(a,i+1));
            Delete(a,i+1);
            Delete(a,j+1);
         end;
      end;
   for i:=1 to lb-1 do
      for j:=i+1 to lb do
      begin
         if get(b,i)>get(b,j) then
         begin
            Insert(b,i,get(b,j));
            Insert(b,j+1,get(b,i+1));
            Delete(b,i+1);
            Delete(b,j+1);
         end;
      end;
   Merge_list(a,b,c);
   writeln('C=:');
   Print(c);
   writeln;
   Union(a,b);
   writeln('A=A U B:');
   Print(A);
   writeln;
end.编译T2_2.PAS,报错如下:error15:File not found (LIST.TPU)
这个问题如何解决?

解决方案 »

  1.   

    缺少list.tpu问题是,你的程序哪里来的?
      

  2.   

    那么书上一定有list.pas放上去
      

  3.   

    把list.pas和T2_2.PAS放在同一个pas文件里,运行的时候报错:can't run a unit!
      

  4.   

    已经用了uses啊
    program t2_2(input,output);
    uses list;
    var
    。。
      

  5.   

    TPU?
    Pascal的Unit编译后的文件
    你是缺少PAS源文件,找回来编译吧http://lysoft.7u7.net
      

  6.   

    缺少PAS源文件?
    list.pas有啊
      

  7.   

    扯蛋,加上
    program Pro_qx;uses
      Forms,
      Pas_qxgl in 'Pas_qxgl.pas' {Frm_qxgl},
      dmright in 'dmright.pas' {DataModule1: TDataModule},
      Pas_public in 'Pas_public.pas';{$R *.res}begin
      Application.Initialize;
      Application.CreateForm(TDataModule1, DataModule1);
      Application.CreateForm(TFrm_qxgl, Frm_qxgl);
      Application.Run;
    end.
    仅供参考