DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Creating an SCO Visual Tcl program -- an overview

Getting the process ID (PID)

# Get handle of list widget

set mainform [ keylget cbs dialog ] set listWidget [ VxGetVar $mainform list ]

# Query list to get selected item

set selProcList [VtListGetSelectedItem $psList -byItemList]

# Get pid from selected list item

set pid [lindex [lindex $selProcList 0] 0]

These steps obtain the PID of the process the user selected.

First, obtain the handle of the list widget to access the process the user selected. To do this:

  1. Use keylget(TCL) to get the handle of the form dialog, which is in this cbs keyed list, and store this in the variable mainform.

  2. Use VxGetVar(VTCL) to get the handle of the list attached to it, and store this in the variable listWidget.
Next, VtListGetSelectedItem(VTCL) returns a list of lists and stores this in the variable selProcList

Finally, lindex(TCL) retrieves the actual process ID from the selected list and stores it in the variable pid. The lindex command retrieves individual elements from a list.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 02 June 2005