[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+---------+################################################################
#+-| EXIST() |-------------------------------------------+####################
#| +---------+ Returns TRUE if the specified file exists |####################
#+-------------------------------------------------------+####################
##############################################################################
##############################################################################
#+--| Summary |----------------+##############################################
#| #INCLUDE system.hdr |##############################################
#+-----------------------------+##############################################
##############################################################################
##############################################################################
#+--| Syntax |------------------------------+#################################
#| FUNCTION LOGICAL exist PROTOTYPE |#################################
#| PARAMETERS CONST CHAR filename |#################################
#+------------------------------------------+#################################
##############################################################################
##############################################################################
##########+---| Description |---------------------------------------+#########
##########| The exist() function returns TRUE if the specified file |#########
##########| file exists. This function is identical to the dBASE |#########
##########| function file(). |#########
##########+---------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Verify existence of a database file before |#########
#########| * using it. |#########
#########| |#########
#########| IF .NOT. exist( "parts.dbf" ) |#########
#########| ? "Database file not found" |#########
#########| QUIT 1 |#########
#########| ENDIF |#########
#########| |#########
#########| USE "parts.dbf" ALIAS parts |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Use the BUILD command to create a database from |#########
#########| * the alias if the database file does not exist. |#########
#########| |#########
#########| DBFDEF a |#########
#########| {...} |#########
#########| ENDDEF |#########
#########| DBFDEF b |#########
#########| {...} |#########
#########| ENDDEF |#########
#########| |#########
#########| PROCEDURE openfile |#########
#########| PARAMETERS ALIAS dalias, CONST CHAR name |#########
#########| IF .NOT. exist( name+".dbf" ) |#########
#########| BUILD name+".dbf" FROM ALIAS dalias |#########
#########| ENDIF |#########
#########| OPEN name+".dbf" ALIAS dalias |#########
#########| ENDPRO |#########
#########| |#########
#########| PROCEDURE force_main |#########
#########| openfile( a,"a" ) |#########
#########| openfile( b,"b" ) |#########
#########| {...} |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
curdir()
curdrive()
filesize()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson