[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+----------+###############################################################
#+-| FB_EOF() |--------------------------------------------------------+######
#| +----------+ Returns TRUE if the file associated with handle is EOF |######
#+---------------------------------------------------------------------+######
##############################################################################
##############################################################################
#+--| Summary |----------------+##############################################
#| #INCLUDE fileio.hdr |##############################################
#+-----------------------------+##############################################
##############################################################################
##############################################################################
#+--| Syntax |-------------------------------+################################
#| FUNCTION LOGICAL fb_eof PROTOTYPE |################################
#| PARAMETERS VALUE UINT handle |################################
#+-------------------------------------------+################################
##############################################################################
##############################################################################
##########+---| Description |---------------------------------------+#########
##########| The fb_eof() function returns TRUE if the file |#########
##########| associated with handle is at EOF. |#########
##########| ------------------------------------------------------- |#########
##########| fb_eof() always return TRUE if the file has been opened |#########
##########| in append mode. Do not use fb_eof() if the file handle |#########
##########| is one of the DOS predefined file handles. |#########
##########+---------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Import a "line" of data from a text file. |#########
#########| |#########
#########| VARDEF |#########
#########| BYTE line[255] |#########
#########| CHAR l BASED line |#########
#########| INT i |#########
#########| ENDDEF |#########
#########| |#########
#########| {...} |#########
#########| i = 0 |#########
#########| DO WHILE .NOT. fb_eof() |#########
#########| fb_read( handle, line[i], 1 ) |#########
#########| i = i + 1 |#########
#########| IF line[i-1] = chr(13) |#########
#########| line[i-1] = 0 |#########
#########| DO process_line WITH line[] |#########
#########| i = 0 |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Suppose an input file has the following structure |#########
#########| * of 16 bytes: |#########
#########| * <INT>:<CHAR(10)>:<LONG> |#########
#########| * Here is how to get the <INT> value into an array. |#########
#########| |#########
#########| DO WHILE .NOT. fb_eof( input_handle ) |#########
#########| fb_read( handle, int_array[i], 2 ) |#########
#########| fb_seek( handle, &FB_CURRENT, 14 ) |#########
#########| i = i + 1 |#########
#########| ENDDO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
fb_close
fb_open()
fb_read()
fb_seek()
fb_write()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson