HB_FSelect

HB_FSelect()

Select a text file workarea

Syntax

      HB_FSelect( [ <nArea> ] ) -> nArea

Argument

<nArea> is the text file workarea to select.

Returns

HB_FSelect() return the current selected text file area number

Description

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.

Example

      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

Seealso

HB_FAtEOF(), HB_FEof(), HB_FGoBottom(), HB_FGoto(), HB_FGoTop(), HB_FInfo(), HB_FLastRec(), HB_FReadAndSkip(), HB_FreadLN(), HB_FRecno(), HB_FSkip(), HB_FUse()

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.