{"id":7435,"date":"2022-12-20T19:38:05","date_gmt":"2022-12-20T22:38:05","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tcl_exprlongobj-man3-3\/"},"modified":"2022-12-20T19:38:05","modified_gmt":"2022-12-20T22:38:05","slug":"tcl_exprlongobj-man3-3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tcl_exprlongobj-man3-3\/","title":{"rendered":"Tcl_ExprLongObj (man3)"},"content":{"rendered":"<h1 align=\"center\">Tcl_ExprLongObj<\/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_ExprLongObj, Tcl_ExprDoubleObj, Tcl_ExprBooleanObj, Tcl_ExprObj \u2212 evaluate an expression<\/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_ExprLongObj<\/b>(<i>interp, objPtr, longPtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_ExprDoubleObj<\/b>(<i>interp, objPtr, doublePtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_ExprBooleanObj<\/b>(<i>interp, objPtr, booleanPtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_ExprObj<\/b>(<i>interp, objPtr, resultPtrPtr<\/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=\"43%\">\n<p style=\"margin-top: 1em\">Tcl_Interp <i>*interp<\/i> (in)<\/p>\n<\/td>\n<td width=\"18%\"><\/td>\n<td width=\"28%\">\n<p style=\"margin-top: 1em\">Interpreter in whose context to evaluate <i>objPtr<\/i>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"43%\">\n<p>Tcl_Obj <i>*objPtr<\/i> (in)<\/p>\n<\/td>\n<td width=\"18%\"><\/td>\n<td width=\"28%\">\n<p>Pointer to a value containing the expression to evaluate.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"43%\">\n<p>long <i>*longPtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"18%\"><\/td>\n<td width=\"28%\">\n<p>Pointer to location in which to store the integer value of the expression.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"43%\">\n<p>int <i>*doublePtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"18%\"><\/td>\n<td width=\"28%\">\n<p>Pointer to location in which to store the floating-point value of the expression.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"43%\">\n<p>int <i>*booleanPtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"18%\"><\/td>\n<td width=\"28%\">\n<p>Pointer to location in which to store the 0\/1 boolean value of the expression.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"43%\">\n<p>Tcl_Obj <i>**resultPtrPtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"18%\"><\/td>\n<td width=\"28%\">\n<p>Pointer to location in which to store a pointer to the value that is the result of the expression.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:72%;\">______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">These four procedures all evaluate an expression, returning the result in one of four different forms. The expression is given by the <i>objPtr<\/i> argument, and it can have any of the forms accepted by the <b>expr<\/b> command.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>interp<\/i> argument refers to an interpreter used to evaluate the expression (e.g. for variables and nested Tcl commands) and to return error information.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For all of these procedures the return value is a standard Tcl result: <b>TCL_OK<\/b> means the expression was successfully evaluated, and <b>TCL_ERROR<\/b> means that an error occurred while evaluating the expression. If <b>TCL_ERROR<\/b> is returned, then a message describing the error can be retrieved using <b>Tcl_GetObjResult<\/b>. If an error occurs while executing a Tcl command embedded in the expression then that error will be returned.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the expression is successfully evaluated, then its value is returned in one of four forms, depending on which procedure is invoked. <b>Tcl_ExprLongObj<\/b> stores an integer value at <i>*longPtr<\/i>. If the expression\u2019s actual value is a floating-point number, then it is truncated to an integer. If the expression\u2019s actual value is a non-numeric string then an error is returned.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_ExprDoubleObj<\/b> stores a floating-point value at <i>*doublePtr<\/i>. If the expression\u2019s actual value is an integer, it is converted to floating-point. If the expression\u2019s actual value is a non-numeric string then an error is returned.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_ExprBooleanObj<\/b> stores a 0\/1 integer value at <i>*booleanPtr<\/i>. If the expression\u2019s actual value is an integer or floating-point number, then they store 0 at <i>*booleanPtr<\/i> if the value was zero and 1 otherwise. If the expression\u2019s actual value is a non-numeric string then it must be one of the values accepted by <b>Tcl_GetBoolean<\/b> such as \u201cyes\u201d or \u201cno\u201d, or else an error occurs.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <b>Tcl_ExprObj<\/b> successfully evaluates the expression, it stores a pointer to the Tcl value containing the expression\u2019s value at <i>*resultPtrPtr<\/i>. In this case, the caller is responsible for calling <b>Tcl_DecrRefCount<\/b> to decrement the value\u2019s reference count when it is finished with the value.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBoolean, Tcl_ExprString, Tcl_GetObjResult<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">boolean, double, evaluate, expression, integer, value, string<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Tcl_ExprLongObj, Tcl_ExprDoubleObj, Tcl_ExprBooleanObj, Tcl_ExprObj \u2212 evaluate an expression <\/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,3747],"class_list":["post-7435","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-man3","tag-tcl_exprlongobj"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7435","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=7435"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7435\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}