Lines 745-754
Link Here
|
745 |
* |
745 |
* |
746 |
* This procedure is called when an error occurs during a |
746 |
* This procedure is called when an error occurs during a |
747 |
* floating-point operation. It reads errno and sets |
747 |
* floating-point operation. It reads errno and sets |
748 |
* interp->result accordingly. |
748 |
* Tcl_GetStringResult(interp) accordingly. |
749 |
* |
749 |
* |
750 |
* Results: |
750 |
* Results: |
751 |
* Interp->result is set to hold an error message. |
751 |
* Tcl_GetStringResult(interp) is set to hold an error message. |
752 |
* |
752 |
* |
753 |
* Side effects: |
753 |
* Side effects: |
754 |
* None. |
754 |
* None. |
Lines 764-783
Link Here
|
764 |
if ((errno == EDOM) || (value != value)) { |
764 |
if ((errno == EDOM) || (value != value)) { |
765 |
Tcl_AppendResult(interp, "domain error: argument not in valid range", |
765 |
Tcl_AppendResult(interp, "domain error: argument not in valid range", |
766 |
(char *)NULL); |
766 |
(char *)NULL); |
767 |
Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", interp->result, |
767 |
Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", Tcl_GetStringResult(interp), |
768 |
(char *)NULL); |
768 |
(char *)NULL); |
769 |
} else if ((errno == ERANGE) || IS_INF(value)) { |
769 |
} else if ((errno == ERANGE) || IS_INF(value)) { |
770 |
if (value == 0.0) { |
770 |
if (value == 0.0) { |
771 |
Tcl_AppendResult(interp, |
771 |
Tcl_AppendResult(interp, |
772 |
"floating-point value too small to represent", |
772 |
"floating-point value too small to represent", |
773 |
(char *)NULL); |
773 |
(char *)NULL); |
774 |
Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", interp->result, |
774 |
Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", Tcl_GetStringResult(interp), |
775 |
(char *)NULL); |
775 |
(char *)NULL); |
776 |
} else { |
776 |
} else { |
777 |
Tcl_AppendResult(interp, |
777 |
Tcl_AppendResult(interp, |
778 |
"floating-point value too large to represent", |
778 |
"floating-point value too large to represent", |
779 |
(char *)NULL); |
779 |
(char *)NULL); |
780 |
Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", interp->result, |
780 |
Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", Tcl_GetStringResult(interp), |
781 |
(char *)NULL); |
781 |
(char *)NULL); |
782 |
} |
782 |
} |
783 |
} else { |
783 |
} else { |
Lines 786-792
Link Here
|
786 |
sprintf(buf, "%d", errno); |
786 |
sprintf(buf, "%d", errno); |
787 |
Tcl_AppendResult(interp, "unknown floating-point error, ", |
787 |
Tcl_AppendResult(interp, "unknown floating-point error, ", |
788 |
"errno = ", buf, (char *)NULL); |
788 |
"errno = ", buf, (char *)NULL); |
789 |
Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", interp->result, |
789 |
Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", Tcl_GetStringResult(interp), |
790 |
(char *)NULL); |
790 |
(char *)NULL); |
791 |
} |
791 |
} |
792 |
} |
792 |
} |
Lines 880-886
Link Here
|
880 |
* was computed successfully. If the name doesn't match any |
880 |
* was computed successfully. If the name doesn't match any |
881 |
* known math function, returns TCL_RETURN. And if a format error |
881 |
* known math function, returns TCL_RETURN. And if a format error |
882 |
* was found, TCL_ERROR is returned and an error message is left |
882 |
* was found, TCL_ERROR is returned and an error message is left |
883 |
* in interp->result. |
883 |
* in Tcl_GetStringResult(interp). |
884 |
* |
884 |
* |
885 |
* After a successful return parsePtr will be updated to point to |
885 |
* After a successful return parsePtr will be updated to point to |
886 |
* the character just after the function call, the token is set |
886 |
* the character just after the function call, the token is set |
Lines 963-969
Link Here
|
963 |
* Results: |
963 |
* Results: |
964 |
* TCL_OK is returned unless an error occurred while doing lexical |
964 |
* TCL_OK is returned unless an error occurred while doing lexical |
965 |
* analysis or executing an embedded command. In that case a |
965 |
* analysis or executing an embedded command. In that case a |
966 |
* standard Tcl error is returned, using interp->result to hold |
966 |
* standard Tcl error is returned, using Tcl_GetStringResult(interp) to hold |
967 |
* an error message. In the event of a successful return, the token |
967 |
* an error message. In the event of a successful return, the token |
968 |
* and field in parsePtr is updated to refer to the next symbol in |
968 |
* and field in parsePtr is updated to refer to the next symbol in |
969 |
* the expression string, and the expr field is advanced past that |
969 |
* the expression string, and the expr field is advanced past that |
Lines 1211-1217
Link Here
|
1211 |
* |
1211 |
* |
1212 |
* Results: |
1212 |
* Results: |
1213 |
* Normally TCL_OK is returned. The value of the expression is |
1213 |
* Normally TCL_OK is returned. The value of the expression is |
1214 |
* returned in *valuePtr. If an error occurred, then interp->result |
1214 |
* returned in *valuePtr. If an error occurred, then Tcl_GetStringResult(interp) |
1215 |
* contains an error message and TCL_ERROR is returned. |
1215 |
* contains an error message and TCL_ERROR is returned. |
1216 |
* InfoPtr->token will be left pointing to the token AFTER the |
1216 |
* InfoPtr->token will be left pointing to the token AFTER the |
1217 |
* expression, and parsePtr->nextPtr will point to the character just |
1217 |
* expression, and parsePtr->nextPtr will point to the character just |
Lines 1756-1762
Link Here
|
1756 |
* |
1756 |
* |
1757 |
* Results: |
1757 |
* Results: |
1758 |
* The result is a standard Tcl return value. If an error |
1758 |
* The result is a standard Tcl return value. If an error |
1759 |
* occurs then an error message is left in interp->result. |
1759 |
* occurs then an error message is left in Tcl_GetStringResult(interp). |
1760 |
* The value of the expression is returned in *valuePtr, in |
1760 |
* The value of the expression is returned in *valuePtr, in |
1761 |
* whatever form it ends up in (could be string or integer |
1761 |
* whatever form it ends up in (could be string or integer |
1762 |
* or double). Caller may need to convert result. Caller |
1762 |
* or double). Caller may need to convert result. Caller |
Lines 1822-1828
Link Here
|
1822 |
* Results: |
1822 |
* Results: |
1823 |
* Each procedure returns TCL_OK if it succeeds and places result |
1823 |
* Each procedure returns TCL_OK if it succeeds and places result |
1824 |
* information at *resultPtr. If it fails it returns TCL_ERROR |
1824 |
* information at *resultPtr. If it fails it returns TCL_ERROR |
1825 |
* and leaves an error message in interp->result. |
1825 |
* and leaves an error message in Tcl_GetStringResult(interp). |
1826 |
* |
1826 |
* |
1827 |
* Side effects: |
1827 |
* Side effects: |
1828 |
* None. |
1828 |
* None. |
Lines 2010-2016
Link Here
|
2010 |
* Results: |
2010 |
* Results: |
2011 |
* Each of the procedures below returns a standard Tcl result. |
2011 |
* Each of the procedures below returns a standard Tcl result. |
2012 |
* If an error occurs then an error message is left in |
2012 |
* If an error occurs then an error message is left in |
2013 |
* interp->result. Otherwise the value of the expression, |
2013 |
* Tcl_GetStringResult(interp). Otherwise the value of the expression, |
2014 |
* in the appropriate form, is stored at *resultPtr. If |
2014 |
* in the appropriate form, is stored at *resultPtr. If |
2015 |
* the expression had a result that was incompatible with the |
2015 |
* the expression had a result that was incompatible with the |
2016 |
* desired form then an error is returned. |
2016 |
* desired form then an error is returned. |
Lines 2042-2048
Link Here
|
2042 |
Blt_VectorDuplicate(vPtr, value.vPtr); |
2042 |
Blt_VectorDuplicate(vPtr, value.vPtr); |
2043 |
} else { |
2043 |
} else { |
2044 |
register int i; |
2044 |
register int i; |
2045 |
/* No result vector. Put values in interp->result. */ |
2045 |
/* No result vector. Put values in Tcl_GetStringResult(interp). */ |
2046 |
for (i = 0; i < value.vPtr->length; i++) { |
2046 |
for (i = 0; i < value.vPtr->length; i++) { |
2047 |
string = Blt_Dtoa(interp, value.vPtr->valueArr[i]); |
2047 |
string = Blt_Dtoa(interp, value.vPtr->valueArr[i]); |
2048 |
Tcl_AppendElement(interp, string); |
2048 |
Tcl_AppendElement(interp, string); |