Delphi 对象与组件帮助文档

类别:Delphi 点击:0 评论:0 推荐:

 AssignFile 过程
使外部文件的名字与file变量关联

单元

System

种类

文件管理程序

Delphi 语法:

procedure AssignFile(var F; FileName: string);

详细内容:

Call AssignFile to initialize a file variable in Delphi code.
在delphi代码里调用AssignFile初始化一个file变量
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.
F是一个file类型的变量,FileName是string-type的表达式,如果扩展语法开关是开启的,那么PChar

类型也允许使用的

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.
在调用AssignFile后,在F没有关闭之前,变量F将一直与外部文件关联。所有更多对file变量F的操作都

将对应发生在文件名为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.
假如FileName参数是空的,AssignFile将F与标准输入或者标准输出文件关联。假如赋值一个空的名字

,在调用Reset(F)之后,F将引用标准输入文件,而调用Rewrite(F)之后,F将引用标准输出文件。
Do not use AssignFile on a file variable that is already open.
不要将AssignFile用在已经打开的File变量上。
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.
注意:为了避免范围冲突,AssignFile将取代在delphi较早版本中的Assign存储过程,为了向后兼容As

sign仍然有效。

available in early versions of the Delphi product. However, for backward compatibility Assign is still available.

本文地址:http://com.8s8s.com/it/it4777.htm