Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== GET.RECCOUNT===== ^Published By^Date^Version^Knowledge Level^Keywords^ |Revelation Technologies|14 NOV 1989|2.X|EXPERT|GET.RECCOUNT| ==== GET.RECCOUNT ==== GET.RECCOUNT is an external function that counts the number of records in an Advanced Revelation Linear Hash file. <code> rec_count = GET.RECCOUNT(filevar, valid, force_count) </code> ==== Using GET.RECCOUNT ==== This information is available in the header (descriptive block) of all Advanced Revelation files; however a facility is provided to perform an explicit count of the records in the file. This may be necessary for network files that are highly active. For all other files, an accurate count can be determined from information in the header. GET.RECCOUNT works only with Advanced Revelation Linear Hash files. === filevar === Use filevar to pass the file variable for the source file. === valid === Valid returns true if the file accessed is a Linear Hash file. Otherwise, valid is false. === force_count === Use force_count to pass a true or false value. If true, an explicit record count is performed. This should be used only with highly active network files. ==== Values returned ==== GET.RECCOUNT returns the number of records in the file if it was able to access the file. Otherwise, zero (0) is returned. A true or false value is returned in valid, indicating whether the file is a Linear Hash file. ==== Correct Use of GET.RECCOUNT ==== <code> /* The following code performs a record count of the SAMPLE_CUSTOMERS file, both via the standard method of reading the file header, and also by the explicit method, where each record currently available is counted. */ DECLARE FUNCTION GET.RECCOUNT DECLARE SUBROUTINE MSG, FSMSG EQUATE true$ TO 1 EQUATE false$ TO 0 * Get record count from the file header file = "SAMPLE_CUSTOMERS" valid = false$ force.count = false$ OPEN file TO filevar ELSE FSMSG(); STOP count = GET.RECCOUNT(filevar, valid, force_count) IF valid ELSE MSG("record count failed","","",""); STOP no_force = count * Force an explicit record count force_count = true$ count = GET.RECCOUNT(filevar, valid, force_count) force_cnt = count text = no_force:" records were counted without forcing" text<<-1>> = force_cnt:" records were counted when forcing" MSG(text, "", "", "") </code> tips/revmedia/subs11.txt Last modified: 2024/06/19 20:20by 127.0.0.1