Skip to main content

GetSelection

GetSelection winType, winName, bitflags

The GetSelection operation returns information about the selection in the specified window.

Parameters

winType is one of the following keywords:

graph, panel, table, layout, notebook, procedure

winName is the name of a window of the specified type.

When identifying a subwindow with winName, see Subwindow Syntax for details on forming the window hierarchy.

If winType is procedure then winName is actually a procedure window title inside a $"" wrapper, such as:

GetSelection procedure $"DemoLoader.ipf", 3

bitflags is a bitwise parameter that is used in different ways for different window types, as described below. You should use 0 for undefined bits. See Setting Bit Parameters for details about bit settings.

Details

For all window types, GetSelection sets V_flag:

V_flag0:there was no selection when GetSelection was invoked.
1:there was a selection when GetSelection was invoked.

Here is a description of what GetSelection does for each window type:

winTypebitflagsAction
graphDoes nothing.
panelDoes nothing.
table1Sets V_startRow, V_startCol, V_endRow, V_endCol based on the selected cells in the table. The top/left cell, not including the Point column, is (0, 0).
2Sets S_selection to a semicolon-separated list of column names.
4Sets S_dataFolder to a semicolon-separated list of data folders, one for each column.
layout2Sets S_selection to a semicolon separated list of selected objects in the layout layer (not any drawing layers). S_selection will be "" if no objects are selected.
notebook1Sets V_startParagraph, V_startPos, V_endParagraph, V_endPos based on the selected text in the notebook.
2Sets S_selection to the selected text.
4Requires Igor Pro 8.05 or later.
Sets V_startParagraph and V_endParagraph to the left margin and right margin respectively of the current ruler in points relative to the ruler 0 position.
Sets V_startPos, and V_endPos to the left edge and right edge respectively of the selection in points relative to the ruler 0 position.
procedure1Sets V_startParagraph, V_startPos, V_endParagraph, V_endPos based on the selected text in the procedure window.
2Sets S_selection to the selected text.

Examples

In a new experiment, make a table named "Table0" with some columns, and select some combination of rows and columns:

Make wave0 = p
Make wave1 = p + 1
Edit wave0, wave1
ModifyTable selection=(3 , 0 , 8 , 1, 3, 0)

Now execute these commands in a procedure or in the command line:

GetSelection table, Table0, 3
Print V_flag, V_startRow, V_startCol, V_endRow, V_endCol
Print S_selection

This prints the following in the history area:

  1  3  0  8  1
wave0.d;wave1.d;