Seek Statement

Đặt vị trí kế tiếp để đọc/viết trong một tập tin được mở bằng câu lệnh Open.

Đối với các tập tin truy cập ngẫu nhiên, câu lệnh Seek đặt số thứ tự của bản ghi kế tiếp sẽ được truy cập.

Đối với các tập tin khác, câu lệnh tìm nơi Seek đặt vị trí byte ở đó thao tác sẽ xảy ra.

Syntax:

Seek Statement diagram


Seek [#]filePos, {filePos|recordNum}

Parameters:

fileNum: The data channel number used in the Open statement.

filePos, recordNum: Position for the next writing or reading. Position can be a number between 1 and 2,147,483,647. According to the file type, the position indicates the number of the record (files in the Random mode) or the byte position (files in the Binary, Output, Append or Input mode). The first byte in a file is position 1, the second byte is position 2, and so on.

Error codes:

5 Sai gọi thủ tục

52 Tên/số tập tin sai

Seek function

Please support us!