一个弱智问题(50分)

  • 主题发起人 主题发起人 micony
  • 开始时间 开始时间
M

micony

Unregistered / Unconfirmed
GUEST, unregistred user!
送分题,懒得查书了:谁能给我解释一下TFileStream类的seek方法的那几个参数分别是什么
 
看帮助吧,点点mouse 就可以了
 
Resets the current position of the handle stream.

function Seek(Offset: Longint; Origin: Word): Longint; override;

Description

Use Seek to move the current position within the resource associated with the handle stream by the indicated offset. Seek allows an application to read from or write to a particular location within the resource.

The Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values:

Value Meaning

soFromBeginning Offset is from the beginning of the resource. Seek moves to the position Offset. Offset must be >= 0.
soFromCurrent Offset is from the current position in the resource. Seek moves to Position + Offset.
soFromEnd Offset is from the end of the resource. Offset must be <= 0 to indicate a number of bytes before the end of the file.

Seek returns the new value of the Position property, the new current position in the resource.
 
seek是定位文件流的指针,第二个参数有三个值,一,是0时:表示以文件开始为基点定位;
二,是1时:以文件当前位置为基点定位;三,是2时:以文件末尾为基点定位.
同意godzhou说的.
补充godzhou的:
soFromBeginning:从流的开头定位
soFromCurrent:从当前指针定位
soFromEnd :从末尾定位



 
to HYDRALISK13,正是我想要的,to godzhou,谢谢
 
后退
顶部