[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+------------+#############################################################
#+-| RECCOUNT() |--------------------------------+############################
#| +------------+ Returns the number of physical |############################
#| records in the current alias |############################
#+-----------------------------------------------+############################
##############################################################################
##############################################################################
#+--| Summary |------------------+############################################
#| #INCLUDE database.hdr |############################################
#+-------------------------------+############################################
##############################################################################
##############################################################################
#+--| Syntax |------------------------------+#################################
#| FUNCTION LONG reccount PROTOTYPE |#################################
#+------------------------------------------+#################################
##############################################################################
##############################################################################
#########+---| Description |---------------------------------------+##########
#########| The reccount() function returns the number of physical |##########
#########| records in the current alias. SET FILTER TO and SET |##########
#########| DELETE commands do not affect the result of reccount(). |##########
#########+---------------------------------------------------------+##########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Back up a database after each 100+ records |#########
#########| * have been added. |#########
#########| |#########
#########| old_reccount = reccount() |#########
#########| DO edit_and_append |#########
#########| IF reccount() > old_reccount + 100 |#########
#########| DO backup_database |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * An index UDF can contain several expressions as |#########
#########| * long as the UDF returns a value. In this case |#########
#########| * show the percent indexed in the upper right hand |#########
#########| * corner. |#########
#########| |#########
#########| DBFDEF dbf |#########
#########| CHAR(30) name |#########
#########| ENDDEF |#########
#########| |#########
#########| VARDEF PRIVATE |#########
#########| LONG count_recs |#########
#########| ENDDEF |#########
#########| |#########
#########| FUNCTION CHAR indexp |#########
#########| count_recs = count_rec + 1 && show every |#########
#########| && 100 records |#########
#########| IF count_recs % 100 = 0 |#########
#########| @ 0,0 ?? i_str(recno()/reccount()*100); |#########
#########| + "Percent finished" |#########
#########| ENDIF |#########
#########| RETURN dbf->name |#########
#########| ENDPRO |#########
#########| |#########
#########| INDEXDEF |#########
#########| CHAR(30) dind indexp() |#########
#########| ENDDEF |#########
#########| |#########
#########| PROCEDURE force_main |#########
#########| USE "dbf.dbf" ALIAS dbf |#########
#########| INDEX dind |#########
#########| {...} |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
a_reccount()
recno()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson