Select a text file workarea
HB_FSelect( [ <nArea> ] ) -> nArea
<nArea> is the text file workarea to select.
HB_FSelect() return the current selected text file area number
HB_FSelect() selects a text file “workarea” from 1 to 10. A file may or may not be open in the selected area.
Passing 0 for <nArea> selects the next available workarea, similar to Harbour’s SELECT 0 command.
Each file is opened in its own “workarea”, similar to the concept used by dbf files. As provided, a maximum of 10 files (in 10 workareas) can be opened (assuming there are sufficient file handles available).
All the HB_F*() file functions operate on the file in the currently selected text file workarea.
Text file workareas are separate from and independent of Harbour’s database workareas.
HB_FSelect(1) nFile1 := HB_FUse( "test.txt" ) ? HB_FLastRec() // no. of lines in test.txt HB_FSelect(2) nFile2 := HB_FUse( "temp.txt" ) ? HB_FLastRec() // no. of lines in temp.txt