Maptitude GISDK Help |
Maptitude keeps track of a lot of information for each open view. Among these pieces of information is the identity of the current record in the view. You control the current record using any of several GISDK functions.
GISDK uses a record handle to identify a record in a view. The record handle is a string variable that, in most cases, contains a string version of the record ID. However, for ODBC sources (where records may have no ID), the record handle may appear to be an arbitrary string.
The following GISDK functions are used to navigate through the records in a view:
GISDK Function |
Summary |
Gets the record handle of the current record of a view |
|
Finds the first record in a view or selection set based on a sort order |
|
Finds the last record in a view or selection set based on a sort order |
|
Finds the next record in a view or selection set based on a sort order |
|
Finds the previous record in a view or selection set based on a sort order |
|
Converts a map feature ID to a record handle |
|
Locates a record based on the value of a field |
|
Finds the map feature nearest a point location |
|
Finds the map features nearest a point location |
|
Converts a record handle to a map feature ID |
|
Sets the current record of a view |
Here is a typical loop over the records in a view:
view_set = "States|"
// Find the first record. If there are no records, rec is set to null
// Note that we don't really care what rec is, as long as it's not null
rec = GetFirstRecord(view_set, null)
// Now, start the loop by testing to make sure rec is not null
while rec <> null do
// Do whatever processing you want in here...
// Now, get the next record. If there aren't any more, rec is set to null
rec = GetNextRecord(view_set, null, null)
end
Here is a slightly more complicated example that loops over the records in a selection set named "High Population" in alphabetical order by name.
view_set = "States|High Population"
// Find the first record in the set, in ascending alphabetical order
rec = GetFirstRecord(view_set, {{"Name", "Ascending"}})
// Now, start the loop as before...
while rec <> null do
// Do whatever processing you want in here...
// Now, get the next record. If there aren't any more, rec is set to null
rec = GetNextRecord(view_set, null, {{"Name", "Ascending"}})
end
©2025 Caliper Corporation | www.caliper.com |