HB_FReadAndSkip

HB_FReadAndSkip()

Reads the current line and moves the record pointer to the next line / record

Syntax

      HB_FReadAndSkip() --> cLine

Argument

None

Return

The current line in the currently selected text file as a character string.

Description

HB_FReadAndSkip() reads the current line in the currently selected text file and advances the record pointer to the next line.

Example

      // The example fills an array with the lines of a text file,
      // taking advantage of implicit record pointer movement of
      // function HB_FReadAndSkip().

      PROCEDURE Main
         LOCAL cFile := "Textfile.txt"
         LOCAL aLines, nLine := 0, nCount
         LOCAL nFile

         nFile  := HB_FUse( cFile )
         nCount := HB_FLastRec() + 1
         aLines := Array( nCount )

         DO WHILE ++nLine <= nCount
            aLines[ nLine ] := HB_FReadAndSkip()
         ENDDO

         HB_FUse()

         AEval( aLines, {|cLine| QOut( cLine ) } )
      RETURN

Seealso

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

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s