{"id":7120,"date":"2022-12-20T19:35:32","date_gmt":"2022-12-20T22:35:32","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tcl_getint-man3\/"},"modified":"2022-12-20T19:35:32","modified_gmt":"2022-12-20T22:35:32","slug":"tcl_getint-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tcl_getint-man3\/","title":{"rendered":"Tcl_GetInt (man3)"},"content":{"rendered":"<h1 align=\"center\">Tcl_GetInt<\/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_GetInt, Tcl_GetDouble, Tcl_GetBoolean \u2212 convert from string to integer, double, or boolean<\/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_GetInt<\/b>(<i>interp, src, intPtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_GetDouble<\/b>(<i>interp, src, doublePtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_GetBoolean<\/b>(<i>interp, src, boolPtr<\/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=\"35%\">\n<p style=\"margin-top: 1em\">Tcl_Interp <i>*interp<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"34%\">\n<p style=\"margin-top: 1em\">Interpreter to use for error reporting.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"35%\">\n<p>const char <i>*src<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"34%\">\n<p>Textual value to be converted.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"35%\">\n<p>int <i>*intPtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"34%\">\n<p>Points to place to store integer value converted from <i>src<\/i>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"35%\">\n<p>double <i>*doublePtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"34%\">\n<p>Points to place to store double-precision floating-point value converted from <i>src<\/i>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"35%\">\n<p>int <i>*boolPtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"34%\">\n<p>Points to place to store boolean value (0 or 1) converted from <i>src<\/i>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:66%;\">______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">These procedures convert from strings to integers or double-precision floating-point values or booleans (represented as 0- or 1-valued integers). Each of the procedures takes a <i>src<\/i> argument, converts it to an internal form of a particular type, and stores the converted value at the location indicated by the procedure\u2019s third argument. If all goes well, each of the procedures returns <b>TCL_OK<\/b>. If <i>src<\/i> does not have the proper syntax for the desired type then <b>TCL_ERROR<\/b> is returned, an error message is left in the interpreter\u2019s result, and nothing is stored at *<i>intPtr<\/i> or *<i>doublePtr<\/i> or *<i>boolPtr<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_GetInt<\/b> expects <i>src<\/i> to consist of a collection of integer digits, optionally signed and optionally preceded and followed by white space. If the first two characters of <i>src<\/i> after the optional white space and sign are \u201c<b>0x<\/b>\u201d then <i>src<\/i> is expected to be in hexadecimal form; otherwise, if the first such characters are \u201c<b>0o<\/b>\u201d then <i>src<\/i> is expected to be in octal form; otherwise, if the first such characters are \u201c<b>0b<\/b>\u201d then <i>src<\/i> is expected to be in binary form; otherwise, if the first such character is \u201c<b>0<\/b>\u201d then <i>src<\/i> is expected to be in octal form; otherwise, <i>src<\/i> is expected to be in decimal form.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_GetDouble<\/b> expects <i>src<\/i> to consist of a floating-point number, which is: white space; a sign; a sequence of digits; a decimal point \u201c<b>.<\/b>\u201d; a sequence of digits; the letter \u201c<b>e<\/b>\u201d; a signed decimal exponent; and more white space. Any of the fields may be omitted, except that the digits either before or after the decimal point must be present and if the \u201c<b>e<\/b>\u201d is present then it must be followed by the exponent number. If there are no fields apart from the sign and initial sequence of digits (i.e., no decimal point or exponent indicator), that initial sequence of digits should take one of the forms that <b>Tcl_GetInt<\/b> supports, described above. The use of \u201c<b>,<\/b>\u201d as a decimal point is not supported nor should any other sort of inter-digit separator be present.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_GetBoolean<\/b> expects <i>src<\/i> to specify a boolean value. If <i>src<\/i> is any of <b>0<\/b>, <b>false<\/b>, <b>no<\/b>, or <b>off<\/b>, then <b>Tcl_GetBoolean<\/b> stores a zero value at <i>*boolPtr<\/i>. If <i>src<\/i> is any of <b>1<\/b>, <b>true<\/b>, <b>yes<\/b>, or <b>on<\/b>, then 1 is stored at <i>*boolPtr<\/i>. Any of these values may be abbreviated, and upper-case spellings are also acceptable.<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">boolean, conversion, double, floating-point, integer<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Tcl_GetInt, Tcl_GetDouble, Tcl_GetBoolean \u2212 convert from string to integer, double, or boolean <\/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,3459],"class_list":["post-7120","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-man3","tag-tcl_getboolean"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7120","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=7120"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7120\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}