set(n) Tcl Built-In Commands set(n) _________________________________________________________________ NAME set - Read and write variables SYNOPSIS set _v_a_r_N_a_m_e ?_v_a_l_u_e? _________________________________________________________________ DESCRIPTION Returns the value of variable _v_a_r_N_a_m_e. If _v_a_l_u_e is speci- fied, then set the value of _v_a_r_N_a_m_e to _v_a_l_u_e, creating a new variable if one doesn't already exist, and return its value. If _v_a_r_N_a_m_e contains an open parenthesis and ends with a close parenthesis, then it refers to an array element: the characters before the first open parenthesis are the name of the array, and the characters between the parentheses are the index within the array. Otherwise _v_a_r_N_a_m_e refers to a scalar variable. If no procedure is active, then _v_a_r_N_a_m_e refers to a global variable. If a procedure is active, then _v_a_r_N_a_m_e refers to a parameter or local variable of the pro- cedure unless the _g_l_o_b_a_l command has been invoked to declare _v_a_r_N_a_m_e to be global. KEYWORDS read, write, variable Tcl Last change: 1