var
  fin:textfile;
  fout, fout1:textfile;  assignfile(fin,label1.Caption);  // ????
  reset(fin);      //????
  assignfile(fout,label2.Caption); //???
  rewrite(fout);   //????

解决方案 »

  1.   

    Associates the name of an external file with a file variable.UnitSystemCategoryfile management routinesDelphi syntax:procedure AssignFile(var F; FileName: string);DescriptionCall AssignFile to initialize a file variable in Delphi code. F is a file variable of any file type. FileName is a string-type expression or an expression of type PChar if extended syntax is enabled. After calling AssignFile, F is associated with the external file until F is closed.  All further operations on the file variable F operate on the external file named by FileName.When the FileName parameter is empty, AssignFile associates F with the standard input or standard output file. If assigned an empty name, after a call to Reset (F), F refers to the standard input file, and after a call to Rewrite (F), F refers to the standard output file.Do not use AssignFile on a file variable that is already open.Note: To avoid scope conflicts, AssignFile replaces the Assign procedure that was available in early versions of the Delphi product. However, for backward compatibility Assign is still available.
      

  2.   

    assignfile 初始化一个文件变量。。reset 打开文件rewrite  新建一个文件并打开。