Purpose
Returns TRUE if a specific node in a region, polyline or multipoint object has an m-value. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
ObjectNodeHasM( object, polygon_num, node_num )
object is an Object expression.
polygon_num is a positive integer value indicating which polygon or section to query. It is ignored for Multipoint objects (it used for regions and polylines).
node_num is a positive integer value indicating which node to read.
Return Value
Logical
Description
The ObjectNodeHasM() function returns TRUE if the specific node from a region, polyline, or multipoint object has an m-value.
The polygon_num parameter must have a value of one or more. This specifies which polygon (if querying a region) or which section (if querying a polyline) should be queried. Call the ObjectInfo() function to determine the number of polygons or sections in an object. The ObjectNodeHasM() function supports Multipoint objects and returns TRUE if a specific node in a Multipoint object has an m-value.
The node_num parameter must have a value of one or more; this tells MapBasic which of the object's nodes should be queried. You can use the ObjectInfo() function to determine the number of nodes in an object.
If the object does not support m-values or an m-value for this node is not defined, it returns FALSE.
Example
The following example queries the first graphic object in the table Routes. If the first object is a polyline, the program queries if the first node in the object has z-coordinates or m-values and queries z-coordinates and m-values of the first node in the polyline.
Dim i_obj_type As SmallInt,
z, m As Float
hasZ, hasM as Logical
Open Table "routes"
Fetch First From routes
' at this point, the expression:
' routes.obj
' represents the graphical object that's attached
' to the first record of the routes table.
i_obj_type = ObjectInfo(routes.obj, OBJ_INFO_TYPE)
If i_obj_type = OBJ_PLINE Then
' ... then the object is a polyline...
If (ObjectNodeHasZ(routes.obj, 1, 1)) Then
z = ObjectNodeZ(routes.obj, 1, 1) ' read z-coordinate
End If
If (ObjectNodeHasM(routes.obj, 1, 1)) Then
m = ObjectNodeM(routes.obj, 1, 1) ' read m-value
End If
End If
See Also:
Querying Map Objects, ObjectInfo() function