{"id":6354,"date":"2022-12-20T18:58:12","date_gmt":"2022-12-20T21:58:12","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/for-mann\/"},"modified":"2022-12-20T18:58:12","modified_gmt":"2022-12-20T21:58:12","slug":"for-mann","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/for-mann\/","title":{"rendered":"for (mann)"},"content":{"rendered":"<h1 align=\"center\">for<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/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\">for \u2212 \u2019For\u2019 loop<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>for<\/b> <i>start test next body<\/i> ______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>For<\/b> is a looping command, similar in structure to the C <b>for<\/b> statement. The <i>start<\/i>, <i>next<\/i>, and <i>body<\/i> arguments must be Tcl command strings, and <i>test<\/i> is an expression string. The <b>for<\/b> command first invokes the Tcl interpreter to execute <i>start<\/i>. Then it repeatedly evaluates <i>test<\/i> as an expression; if the result is non-zero it invokes the Tcl interpreter on <i>body<\/i>, then invokes the Tcl interpreter on <i>next<\/i>, then repeats the loop. The command terminates when <i>test<\/i> evaluates to 0. If a <b>continue<\/b> command is invoked within <i>body<\/i> then any remaining commands in the current execution of <i>body<\/i> are skipped; processing continues by invoking the Tcl interpreter on <i>next<\/i>, then evaluating <i>test<\/i>, and so on. If a <b>break<\/b> command is invoked within <i>body<\/i> or <i>next<\/i>, then the <b>for<\/b> command will return immediately. The operation of <b>break<\/b> and <b>continue<\/b> are similar to the corresponding statements in C. <b>For<\/b> returns an empty string.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Note: <i>test<\/i> should almost always be enclosed in braces. If not, variable substitutions will be made before the <b>for<\/b> command starts executing, which means that variable changes made by the loop body will not be considered in the expression. This is likely to result in an infinite loop. If <i>test<\/i> is enclosed in braces, variable substitutions are delayed until the expression is evaluated (before each loop iteration), so changes in the variables will be visible. See below for an example:<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Print a line for each of the integers from 0 to 9:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>for<\/b> {set x 0} {$x<10} {incr x} { <br \/> puts &#8220;x is $x&#8221; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Either loop infinitely or not at all because the expression being evaluated is actually the constant, or even generate an error! The actual behaviour will depend on whether the variable <i>x<\/i> exists before the <b>for<\/b> command is run and whether its value is a value that is less than or greater than\/equal to ten, and this is because the expression will be substituted before the <b>for<\/b> command is executed.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>for<\/b> {set x 0} $x<10 {incr x} { <br \/> puts &#8220;x is $x&#8221; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Print out the powers of two from 1 to 1024:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>for<\/b> {set x 1} {$x<=1024} {set x [expr {$x bodies manpages.csv script_extrae_body.sh script.sh usr 2}]} { <br \/> puts &#8220;x is $x&#8221; <br \/> }<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">break(n), continue(n), foreach(n), while(n)<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">boolean, for, iteration, loop<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  for \u2212 \u2019For\u2019 loop <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3783,1],"tags":[2938,2635],"class_list":["post-6354","post","type-post","status-publish","format-standard","hentry","category-n-comandos-tcl-tk","category-sin-categoria","tag-for","tag-mann"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6354","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=6354"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6354\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}