Purpose
Returns the Pen (line) style currently in use and sets the border pen to the same style as the line pen. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
CurrentPen()
Return Value
Pen
Description
The CurrentPen() function returns the current Pen style. MapInfo Pro assigns the current style to any line or polyline objects drawn by the user. If a MapBasic program creates an object through a statement such as the Create Line statement, but the statement does not include a Pen clause, the object uses the current Pen style. If you want to use the current line pen without re-setting the border pen, use the CurrentLinePen() function.
The return value can be assigned to a Pen variable, or may be used as a parameter within a statement that takes a Pen setting as a parameter (such as the Set Map statement).
To extract specific attributes of the Pen style (such as the color), call the StyleAttr() function. For more information about Pen settings, see Pen clause.
Example
Dim p_user_pen As Pen
p_user_pen = CurrentPen()
See Also:
MakePen() function, Pen clause, Set Style statement, StyleAttr() function