{"id":7423,"date":"2022-12-20T19:38:02","date_gmt":"2022-12-20T22:38:02","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tcl_wrongnumargs-man3\/"},"modified":"2022-12-20T19:38:02","modified_gmt":"2022-12-20T22:38:02","slug":"tcl_wrongnumargs-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tcl_wrongnumargs-man3\/","title":{"rendered":"Tcl_WrongNumArgs (man3)"},"content":{"rendered":"<h1 align=\"center\">Tcl_WrongNumArgs<\/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=\"#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\">Tcl_WrongNumArgs \u2212 generate standard error message for wrong number of arguments<\/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\"><b>Tcl_WrongNumArgs<\/b>(<i>interp, objc, objv, message<\/i>)<\/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=\"40%\">\n<p style=\"margin-top: 1em\">Tcl_Interp <i>interp<\/i> (in)<\/p>\n<\/td>\n<td width=\"18%\"><\/td>\n<td width=\"31%\">\n<p style=\"margin-top: 1em\">Interpreter in which error will be reported: error message gets stored in its result value.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"40%\">\n<p>int <i>objc<\/i> (in)<\/p>\n<\/td>\n<td width=\"18%\"><\/td>\n<td width=\"31%\">\n<p>Number of leading arguments from <i>objv<\/i> to include in error message.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"40%\">\n<p>Tcl_Obj *const <i>objv[]<\/i> (in)<\/p>\n<\/td>\n<td width=\"18%\"><\/td>\n<td width=\"31%\">\n<p>Arguments to command that had the wrong number of arguments.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"40%\">\n<p>const char <i>*message<\/i> (in)<\/p>\n<\/td>\n<td width=\"18%\"><\/td>\n<td width=\"31%\">\n<p>Additional error information to print after leading arguments from <i>objv<\/i>. This typically gives the acceptable syntax of the command. This argument may be NULL.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:69%;\">______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_WrongNumArgs<\/b> is a utility procedure that is invoked by command procedures when they discover that they have received the wrong number of arguments. <b>Tcl_WrongNumArgs<\/b> generates a standard error message and stores it in the result value of <i>interp<\/i>. The message includes the <i>objc<\/i> initial elements of <i>objv<\/i> plus <i>message<\/i>. For example, if <i>objv<\/i> consists of the values <b>foo<\/b> and <b>bar<\/b>, <i>objc<\/i> is 1, and <i>message<\/i> is \u201c<b>fileName count<\/b>\u201d then <i>interp<\/i>\u2019s result value will be set to the following string:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">wrong # args: should be &#8220;foo fileName count&#8221;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <i>objc<\/i> is 2, the result will be set to the following string:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">wrong # args: should be &#8220;foo bar fileName count&#8221;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>Objc<\/i> is usually 1, but may be 2 or more for commands like <b>string<\/b> and the Tk widget commands, which use the first argument as a subcommand.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Some of the values in the <i>objv<\/i> array may be abbreviations for a subcommand. The command <b>Tcl_GetIndexFromObj<\/b> will convert the abbreviated string value into an <i>indexObject<\/i>. If an error occurs in the parsing of the subcommand we would like to use the full subcommand name rather than the abbreviation. If the <b>Tcl_WrongNumArgs<\/b> command finds any <i>indexObjects<\/i> in the <i>objv<\/i> array it will use the full subcommand name in the error message instead of the abbreviated name that was originally passed in. Using the above example, let us assume that <i>bar<\/i> is actually an abbreviation for <i>barfly<\/i> and the value is now an <i>indexObject<\/i> because it was passed to <b>Tcl_GetIndexFromObj<\/b>. In this case the error message would be:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">wrong # args: should be &#8220;foo barfly fileName count&#8221;<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_GetIndexFromObj(3)<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">command, error message, wrong number of arguments<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Tcl_WrongNumArgs \u2212 generate standard error message for wrong number of arguments <\/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,3735],"class_list":["post-7423","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-man3","tag-tcl_wrongnumargs"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7423","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=7423"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7423\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}