Chapter Contents


Organizational Chart: _getChildren

Organizational Chart: _getChildren

Returns a list containing all of a node's direct children, or all levels of children, grandchildren, and so forth down the tree



CALL NOTIFY (orgchart-name, '_getChildren', node-id, list-of-names, list-id<, all-levels>);

Argument Type Description
N specifies the numeric identifier of the node
C specifies a single, quoted text string containing the names of the node variables whose values are to be returned in list-id. Separate multiple node variable names with a space. Specify 'ALL ' to return the value of all variables. You can include these options in the string:

/F return the number of direct children. If both /F and all-levels are specified, all-levels is ignored.

/R return lists in reverse order.
N returns the identifier of an SCL list containing a sublist for each child of the specified node. The length of the list is the number of children the specified node has. Each sublist contains the values requested in list-of-names for the child node. If list-of-names is '/F ', then list-id returns the actual number of child nodes instead of a list identifier.
C specifies whether to return all levels of node children:

'N' only direct children (the default)

'Y' all levels of children


Although the method automatically creates list-id if its value is missing or 0, you must delete it with the DELLIST function after you have finished with it.


This example retrieves the displayed text, character value, identification number assigned by the user, and observation number of each direct child of the selected node and stores it in OUTLIST.

This code must be in a labeled section of the SCL program associated with the frame. The labeled section can be either the organizational chart's labeled section (in this case the section labeled ORG1), or a labeled section specified in the Select Action window:

      /* Get the identifiers of the 
         organizational chart object */
      /* and of the selected node */
   call notify ('org1', '_get_selected_',
                 widgetid, nodeid);
   if (nodeid eq 0) then return;
      /* Specify the items whose values you
         want to retrieve */
   buff='text cvalue id obs';
      /* Get the values from the child nodes
         and return them in OUTLIST*/
   call notify ('org1', '_get_children_', 
                 nodeid, buff, outlist);

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.