Repositioning a Sculptor keyed file or secondary index at its start

rewind

Reposition a Sculptor keyed file or secondary index at its start


SYNTAX

rewind file_id [index = index_id]

Repositions the specified file or secondary index at its start, so that a subsequent next[u] or nextkey command retrieves the first record in the file, or the record pointed to by the first key in the index specified. The contents of the file’s record buffer are not affected.

file_id

The file_id must be the identifier assigned to a Sculptor keyed file which has been declared in the program by means of the !ofile declaration, or which has been declared by the !file declaration and subsequently opened.

[index = index_id]

This clause may be used to specify a secondary index to be rewound. This must be the name of an index created for the file using the ddeditor program. If the index = clause is present the main file position remains unchanged. If it is absent, the main file is rewound.


NOTES

  • The next[u] and nextkey commands cannot return a record whose key is entirely null, i.e. all bytes binary zero.


EXAMPLE

rewind Diary
rewind Samples index = RefCode

RELATED TOPICS

Sculptor keyed files

File position

wind

next[u]

nextkey