pprriinnttUUnniittVVaalluueess -- pprriinnttss vvaalluueess ffoorr eeaacchh uunniitt iinn aa lliisstt ooff ggrroouuppss ttoo aa ffiillee UUSSAAGGEE printUnitValues [-append] DDEESSCCRRIIPPTTIIOONN This command is used to print information about units to a file. It traverses the units in the specified groups and calls the printProc Tcl procedure for each unit. The procedure should take two arguments: the path to the group object and the path to the unit object. Whatever string the procedure returns will be written to the file. The user, thus, determines the format of the output. In fact, the _f_o_r_m_a_t Tcl command may come in very handy here. The file can use any of the standard Lens _f_i_l_e_ _t_y_p_e_s, including ordinary files, compressed files, pipelines, Tcl file handles, and a "-" for standard output. If you would like to periodically write values to a file, after each example for instance, you could _o_p_e_n a Tcl file, call printUnitValues after each example (maybe using the network's postExampleProc) and then _c_l_o_s_e the Tcl file, or simply use the -append flag, which causes the output to be appended to the file. Lesioned units are ignored when the values are printed. EEXXAAMMPPLLEESS In this example, the group name, unit number, and unit output for every unit in the groups out1 and out2 are appended to the compressed file "helloKitty.gz": lens> proc printStuff {group unit} { format "%s %-3d %.3f\n" [getObj $group.name] [getObj $unit.num] \ [getObj $unit.output] } lens> printUnitValues helloKitty.gz printStuff {out1 out2} -a SSEEEE AALLSSOO _p_r_i_n_t_L_i_n_k_V_a_l_u_e_s --------------------------------------------------------------------------- Last modified: Mon Jun 8.33:59:51 EDT 1998