{"id":7017,"date":"2022-12-20T19:34:39","date_gmt":"2022-12-20T22:34:39","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tcl_upvar-man3\/"},"modified":"2022-12-20T19:34:39","modified_gmt":"2022-12-20T22:34:39","slug":"tcl_upvar-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tcl_upvar-man3\/","title":{"rendered":"Tcl_UpVar (man3)"},"content":{"rendered":"<h1 align=\"center\">Tcl_UpVar<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#ARGUMENTS\">ARGUMENTS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#KEYWORDS\">KEYWORDS<\/a> <\/p>\n<hr>\n<p>______________________________________________________________________________<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_UpVar, Tcl_UpVar2 \u2212 link one variable to another<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <tcl.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_UpVar(<\/b><i>interp, frameName, sourceName, destName, flags<\/i><b>)<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_UpVar2(<\/b><i>interp, frameName, name1, name2, destName, flags<\/i><b>)<\/b><\/p>\n<h2>ARGUMENTS <a name=\"ARGUMENTS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p style=\"margin-top: 1em\">Tcl_Interp <i>*interp<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"32%\">\n<p style=\"margin-top: 1em\">Interpreter containing variables; also used for error reporting.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>const char <i>*frameName<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"32%\">\n<p>Identifies the stack frame containing source variable. May have any of the forms accepted by the <b>upvar<\/b> command, such as <b>#0<\/b> or <b>1<\/b>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>const char <i>*sourceName<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"32%\">\n<p>Name of source variable, in the frame given by <i>frameName<\/i>. May refer to a scalar variable or to an array variable with a parenthesized index.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>const char <i>*destName<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"32%\">\n<p>Name of destination variable, which is to be linked to source variable so that references to <i>destName<\/i> refer to the other variable. Must not currently exist except as an upvar-ed variable.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>int <i>flags<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"32%\">\n<p>One of <b>TCL_GLOBAL_ONLY<\/b>, <b>TCL_NAMESPACE_ONLY<\/b> or 0; if non-zero, then <i>destName<\/i> is a global or namespace variable; otherwise it is local to the current procedure (or current namespace if no procedure is active).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>const char <i>*name1<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"32%\">\n<p>First part of source variable\u2019s name (scalar name, or name of array without array index).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>const char <i>*name2<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"32%\">\n<p>If source variable is an element of an array, gives the index of the element. For scalar source variables, is NULL.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:68%;\">______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_UpVar<\/b> and <b>Tcl_UpVar2<\/b> provide the same functionality as the <b>upvar<\/b> command: they make a link from a source variable to a destination variable, so that references to the destination are passed transparently through to the source. The name of the source variable may be specified either as a single string such as <b>xyx<\/b> or <b>a(24)<\/b> (by calling <b>Tcl_UpVar<\/b>) or in two parts where the array name has been separated from the element name (by calling <b>Tcl_UpVar2<\/b>). The destination variable name is specified in a single string; it may not be an array element.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Both procedures return either <b>TCL_OK<\/b> or <b>TCL_ERROR<\/b>, and they leave an error message in the interpreter\u2019s result if an error occurs.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">As with the <b>upvar<\/b> command, the source variable need not exist; if it does exist, unsetting it later does not destroy the link. The destination variable may exist at the time of the call, but if so it must exist as a linked variable.<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">linked variable, upvar, variable<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Tcl_UpVar, Tcl_UpVar2 \u2212 link one variable to another <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,3007,3367],"class_list":["post-7017","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-man3","tag-tcl_upvar"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7017"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7017\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}