Free Pascal的Seek语句怎么用。

来源:百度知道 编辑:UC知道 时间:2024/06/07 06:40:49
例如,编译“Seek(Output,3)”时候提示Error: Call by var parameters have to match exactly: Got "Text" expected "File"。
难道Output不是文件类型?

只能将output,重新定义成file类型的文件,而不能使用text类型的文件。

一、有类型文件的定义
有类型文件中的元素可以是混合型的,并以二进制格式存贮,因此有类型文件(除了字符类型文件,因为它实质上是文本文件)不象文本文件那样可以用编辑软件等进行阅读和处理。
有类型文件的类型说明的格式为:
类型标识符=File of 基类型;
其中基类型可以是除了文件类型外的任何类型。例如:
file1=file of integer;
file2=file of array[1..10] of string;
file3=file of set of char;
file4=file of real;
file5=file of record;
name:string;
course:array[1..10] of real;
sum:real;
end;
等等,其中file2,file3,file5中的数组、集合、记录等类型可以先说明再来定义文件变量。
例如:
var
f1:file1;
f2,f3:file3;
f4:file5;
与前面所有类型说明和变量定义一样,文件类型说明和变量定义也可以合并在一起,例如:
var
f1:file of integer;
f2,f3:file of set of char;
file4=file of record;
name:string;
course:array[1..10] of real;
sum:real;
end;

Free Pascal对有类型文件的访