[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+-----------+##############################################################
#+-| NET_ERR() |-------------------------------------+########################
#| +-----------+ Returns the last network error code |########################
#+---------------------------------------------------+########################
##############################################################################
##############################################################################
#+--| Summary |---------------+###############################################
#| #INCLUDE error.hdr |###############################################
#+----------------------------+###############################################
##############################################################################
##############################################################################
#+--| Syntax |-----------------------------+##################################
#| FUNCTION UINT net_err PROTOTYPE |##################################
#+-----------------------------------------+##################################
##############################################################################
##############################################################################
##########+---| Description |--------------------------------------+##########
##########| The net_err() function returns the last network error |##########
##########| code. The error code returned is the DOS extended |##########
##########| error code. see your DOS reference manual for the DOS |##########
##########| extended error codes. |##########
##########| ------------------------------------------------------ |##########
##########| Use net_err() to obtain information as to why a file |##########
##########| did not open. |##########
##########+--------------------------------------------------------+##########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Make sure a network database is opened. |#########
#########| |#########
#########| OPEN "f:\data\acct.dbf" ALIAS accts |#########
#########| IF net_err() > 0 |#########
#########| ? "Network error #: ",net_err() |#########
#########| ? "Database not opened." |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * A generic "try to open a database" function. |#########
#########| |#########
#########| FUNCTION LOGICAL try_to_open |#########
#########| PARAMETERS CONST CHAR name, ALIAS a, ; |#########
#########| VALUE INT trytime |#########
#########| |#########
#########| DO WHILE trytime > 0 |#########
#########| OPEN name ALIAS a |#########
#########| IF net_err() > 0 |#########
#########| trytime = trytime -1 |#########
#########| delay( 1 ) |#########
#########| LOOP |#########
#########| ENDIF |#########
#########| RETURN .T. |#########
#########| ENDDO |#########
#########| RETURN .F. |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
OPEN
SET EXCLUSIVE
USE
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson