Maptitude GISDK Help |
Gets the number of records in a view or selection set.
record_count = GetRecordCount(string view_name, string set_name)
Argument |
Contents |
view_name |
The name of the view |
set_name |
The name of the selection set, or null to count all records in the view |
An integer indicating the number of records in the view or selection set.
If a selection set is specified, the returned count is exact.
If a selection set is not specified, GetRecordCount() reports the best estimate available from the underlying data tables. For dBASE, fixed-format text, and fixed-format binary tables, this is the total number of records in the file, including those that are marked as deleted and not yet removed. For comma-separated text tables, because there can be no records marked for deletion, the exact number of records is returned. For joined views, GetRecordCount() may or may not return an exact count; in the case of one-to-many joins, it returns -1, because no information is available.
Certain operations cause an update of the count. For example, if a user pages down the entire way through a dataview, the count will be updated and become exact. Using GetDataVector() on the entire view, or calling SelectAll() will also update the count.
In all cases, if the returned value is 0, the view is empty. If the returned value is positive, then it is either an exact count or an upper bound. If the returned value is -1, then no information is available.
//Open BDOCUMENTS\CALIPER\\< product name>\TUTORIAL\NElayers.wrkz
tutorial_folder = RunMacro("G30 Tutorial Folder")
wrkz = OpenWorkspace(tutorial_folder + "NElayers.wrkz")
nrec = GetRecordCount("Place", "Selection")
ShowMessage("There are " + String(nrec) + " places selected .")
Error Type |
Meaning |
NotFound |
The specified view or set does not exist, or the view_name is null and there is no current view. |
Function |
Summary |
Gets an array of record handles for a selection set |
|
Gets the number of records in a set in the current view |
|
Tests whether a record is a member of a selection set. |
©2025 Caliper Corporation | www.caliper.com |