[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+------------+#############################################################
#+-| A_HEADER() |-------------------------------------+#######################
#| +------------+ Returns size of the database header |#######################
#+----------------------------------------------------+#######################
##############################################################################
##############################################################################
#+--| Summary |------------------+############################################
#| #INCLUDE database.hdr |############################################
#+-------------------------------+############################################
##############################################################################
##############################################################################
#+--| Syntax |------------------------------+#################################
#| FUNCTION LONG a_header PROTOTYPE |#################################
#| PARAMETERS ALIAS aliasname |#################################
#+------------------------------------------+#################################
##############################################################################
##############################################################################
##########+---| Description |--------------------------------------+##########
##########| The a_header() function returns the header size of the |##########
##########| database file associated with the specified aliasname. |##########
##########| ------------------------------------------------------ |##########
##########| The a_header() function performs identically to the |##########
##########| header() function. a_header() differs syntactically |##########
##########| in that it accepts an alias as a parameter. |##########
##########+--------------------------------------------------------+##########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Two databases might have the same structure |#########
#########| * if their header sizes are equal. Use this |#########
#########| * test to eliminate candidates for faster |#########
#########| * processing. |#########
#########| |#########
#########| IF a_header( a ) = a_header( b ) |#########
#########| RETURN analyze_more( a, b ) |#########
#########| ELSE |#########
#########| RETURN .f. |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * This example encodes a copy_size() function, |#########
#########| * which returns the number of bytes required to |#########
#########| * copy the specified database WITHOUT deleted |#########
#########| * records. (i.e., it is assumed the database |#########
#########| * will be packed prior to the copy). |#########
#########| |#########
#########| #include database.hdr |#########
#########| FUNCTION LONG copy_size |#########
#########| PARAMETERS ALIAS a |#########
#########| VARDEF |#########
#########| LONG delete_count |#########
#########| ENDDEF |#########
#########| |#########
#########| !a COUNT ALL FOR a_deleted( a ) TO delete_count |#########
#########| RETURN a_header( a ) ; |#########
#########| + ( a_reccount( a ) * a_recsize( a )) ; |#########
#########| - ( delete_count * a_recsize( a )) |#########
#########| |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 3 |-------------------------------------------+#########
#########| * An alias can be a parameter to a function or |#########
#########| * procedure. This function returns TRUE if two |#########
#########| * headers are equal in size. |#########
#########| |#########
#########| FUNCTION LOGICAL equal_headers |#########
#########| PARAMETERS ALIAS first, ALIAS second |#########
#########| RETURN a_header( first ) = a_header( second ) |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
header()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson