type
  pfile_type=^file_type;
  File_Type = record
  drive :shortint;
  next: pfile_type;
  pathname:array[0..511] of char;
   iprotype:shortint;
  end;

解决方案 »

  1.   

    node.PathName:=edit1.text;[Error] Unit1.pas(48): Incompatible types: 'Array' and 'TCaption'怎么把字符号转换为Array
      

  2.   

    Type 
    PFile_Type=^File_Type;
    File_Type=Record
      Driver:ShortInt;
      PathName:Array[1..512] of Char;
      Next:PFile_Type;
      iProType:ShortInt;
    End;  
      

  3.   

    怎么没人解决第二个问题呢,Delphi中怎样解决类型转换问题呢
      

  4.   

    两种方法:
    1、修改Pathname的定义,改为:PathName:string
    2、strPCopy(PathName, edit1.Text);
      

  5.   

    第一种方法因为传进去的参数为字符数组。
    第二种方法时  
          strpcopy(node.PathName,edit1.text);
    出现如下错误
         [Error] Unit1.pas(48): Incompatible types: 'Array' and 'PChar'
      

  6.   

    怪了,我的是对的
    如下:
    Type
    PFile_Type=^File_Type;
    File_Type=Record
      Driver:ShortInt;
      PathName:Array[0..512] of Char;
                    ~~~~~~~~~~
      Next:PFile_Type;
      iProType:ShortInt;
    End;
    var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var s:file_type;
    begin
    strpcopy(s.PathName,edit1.text);
    edit2.text:=strpas(s.pathname);
    end;