GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Nine — Dialog Functions (continued)
DataControlGetSelectList Function
Overview
The DataControlGetSelectList function retrieves the number of selected items as an array of rows and columns.
Syntax/Parameters
Syntax
int [][] = DataControlGetSelectList ( int id );
Parameters
id
An int containing the control ID of the data control.
Return Value
An int table containing the selected items within a data control, empty if none are selected, or empty on failure. Common error codes are as follows: ERROR_RANGE if id is an invalid control ID for the open dialog or ERROR_INVALID_HANDLE if no dialog is open. Use the GetLastError function to retrieve error information.
Remarks
The table returns is index as a table row for each selected item with the columns as “Row” and “Col” key names for the 0th and 1th positions, respectively. The number of select items can be obtained by getting the axis depth for the AXIS_ROW.
Returned values are zero-based. In row select mode, the all column fields are returned as -1.
An example of dumping selections from a select action.
int rc_action(int c_id, int c_action) { int list[200][2]; int rows; int ix; int rc; if (c_id == LIST) { if (c_action == DCN_SELECT_CHANGE) { rc = DataControlGetSelectCount(LIST); if ((rc > 1) && (rc < 200)) { list = DataControlGetSelectList(LIST); rows = ArrayGetAxisDepth(list, AXIS_ROW); ConsolePrint("Select Data (total count %d):\n", rc); ix = 0; while (ix < rows) { ConsolePrint(" Row: %2d Col:%2d\n", list[ix][0], list[ix][1]); ix++; } } } } return 0; }
LIST is predefined as the dialog control id for a data control. Resources and the DialogBox call is performed elsewhere. In the above action, the list of selected items is dumped to the console on each select change. Note that the list is limited to 200 to avoid constant allocation of an automatic table during the action processing since the action processor gets called frequently and may control actions. Also note, for illustration, the value rc should match rows.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.