GetViews()
Summary
Gets information on views in the system or views associated with a layer.
Syntax
view_info = GetViews(string layer_name)
| Argument | Contents |
|---|---|
| layer_name | The layer whose views are of interest, or null for information on all views |
Returns
An array of three elements:
| Element | Type | Contents |
|---|---|---|
| 1 | Array | An array of view names (strings) |
| 2 | Integer | The index of the current view in the names array, or -1 if there is no current view or the current view is not mappable to layer_name |
| 3 | String | The name of the current view, or null if there is no current view or the current view is not mappable to layer_name |
Notes
-
Call GetViews() with a null argument to obtain a list of all views in the system. Call it with a layer name to get a list of only those views that are associated with (joined to) the layer.
-
When GetViews() is called with a null argument, the returned information covers all views in the system. If there are no views, GetViews() returns null.
-
If the current view is not mappable to the input layer, its name is not returned. To obtain the current view name, either call GetViews() with a null value for layer_name, or use GetView() instead.
Example
// This loop closes all views:
tmp_arr=GetViews()
if tmp_arr<>null then do
for vv=1 to ArrayLength(tmp_arr[1]) do
CloseView(tmp_arr[1][vv])
end
end // if there were views to close
See Also
| Function | Summary |
|---|---|
| GetView() | Gets the name of the current view |
| SetView() | Sets the current view (and the current layer) |
| GetViewNames() | Gets a list of all views |
| GetViewLayer() | Gets the name of the layer corresponding to the input view |
| GetViewParents() | Gets the parentage of a view |