REPOSIT
8.2E, ANSI
The REPOSIT instruction repositions the file's pointer to the specified value. This instruction is normally used in conjunction with the FPOSIT instruction to save and restore a file's pointer. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
file
Required. A previously defined and opened FILE, IFILE, or AFILE variable whose current position is set.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
offset
Required. A previously defined Numeric Variable or Expression containing the byte position to which the file is positioned.
Flags Affected: OVER, ZERO
Note the following:
The value contained in {offset} is where the file pointer is set. If it equals zero (0), the file pointer is set to the beginning of the file.
If the specified location is at the End Of File (EOF), the OVER Condition Flag is set. If it is past the EOF, the ZERO Condition Flag is set.
When using SQLIO, the {offset} positions to the row with a sun_recno field that is one greater than the given value.
If the {offset} value is larger than '0x3fffffffffffffff', the {offset} maximum of '0x3fffffffffffffff' is used. This maximum limit is being applied to avoid unexpected OS errors due to OS limitations. Notice, if the {offset} is a FORM variable with a negative value, the FORM variable is converted to an integer value which is used as the absolute file position. Therefore, on a 32-bit platform, a FORM variable with a '-1' value converts to a 32-bit integer value of '0xFFFFFFFF'. Likewise, on a 64-bit platform, a FORM variable with a '-1' value converts to a 64-bit integer value of '0xffffffffffffffff'.
See Also: Example Code, FPOSIT, FPOSITB, FPOSITC, Disk I/O Instructions
![]() |