BOF(), EOF()
She was a phantom of delight
When first she gleamed upon my sight;
William Wordsworth, She Was a Phantom of Delight, 1807
These functions stand for Beginning Of File and End Of File, respectively. They tell you whether the record pointer is at the start or end of a table or cursor. Usage | lReturnValue = BOF( [cAlias | nWorkArea] ) lReturnValue = EOF( [cAlias | nWorkArea] ) |
Parameter | Value | Meaning |
cAlias | Character | Check the table whose alias is cAlias. |
Omitted | If nWorkArea is also omitted, check the table in the current work area. | |
nWorkArea | Numeric | Check the table currently open in nWorkArea. |
Omitted | If cAlias is also omitted, check the table in the current work area. | |
lReturnValue | .T. | The specified table is at the beginning or end of file, based on the current order. |
.F. | The specified table is not at the beginning or end of file. |
Example | USE Customer ? RECNO() && 1 ? BOF() && .F. * make BOF() true SKIP –1 ? BOF() && .T. ? RECNO() && Still 1 * now go to the bottom GO BOTTOM ? EOF() && .F. ? RECNO() * go to phantom record SKIP ? EOF() && .T. ? RECNO() && Not the same as above; && one more than RECCOUNT() * check for related records USE Parent IN 0 USE Child IN 0 ORDER ParentId SELECT Parent SET RELATION TO ParentId INTO Child * Browse child-less parents BROWSE FOR EOF("Child") * Another way to do this is: BROWSE FOR NOT FOUND("Child") |
See Also | Go, Locate, Seek, Seek(), Set Near, Set Relation, Skip |
View Updates
Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.