Changeset c14b554 in tol for toltcl/generic/tolsergrp.cpp
- Timestamp:
- Oct 19, 2008, 5:56:30 PM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- ce06505
- Parents:
- 6d7779d
- File:
-
- 1 edited
-
toltcl/generic/tolsergrp.cpp (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
toltcl/generic/tolsergrp.cpp
r6d7779d rc14b554 66 66 BDate & begin, 67 67 BDate & end, 68 int RangeIsDefault); 68 int RangeIsDefault, 69 Tcl_Obj *obj_result); 69 70 70 71 static int Tol_CreateSerieGrpData(Tcl_Interp * interp, … … 73 74 BDate & begin, 74 75 BDate & end, 75 int RangeIsDefault); 76 int RangeIsDefault, 77 Tcl_Obj *obj_result); 76 78 77 79 #define TICK_END -1 … … 487 489 488 490 BGrammar * gra = GraTimeSet(); 491 492 if ( !gra ) { 493 Tcl_AppendResult(interp, 494 "TimeSet grammar not found", NULL); 495 return TCL_ERROR; 496 } 497 489 498 BUserTimeSet * uts; 490 499 … … 836 845 } 837 846 tcl_code = Tol_CreateSerieGrpData(interp,objc,series,&sgrp, 838 I0,I1,isDefault );847 I0,I1,isDefault,obj_result); 839 848 if ( tcl_code != TCL_OK ) { 840 849 Tol_FreeSerieGroup(sgrp); 841 Tcl_AppendObjToObj(obj_result,Tcl_GetObjResult(interp));842 850 return TCL_ERROR; 843 851 } … … 886 894 887 895 tcl_code = Tol_CreateSerieGrpData(interp,series,&sgrp, 888 I0,I1,isDefault );896 I0,I1,isDefault,obj_result); 889 897 if ( tcl_code != TCL_OK ) { 890 898 Tol_FreeSerieGroup(sgrp); 891 Tcl_AppendObjToObj(obj_result,Tcl_GetObjResult(interp));892 899 return TCL_ERROR; 893 900 } … … 1536 1543 BDate & begin, 1537 1544 BDate & end, 1538 int RangeIsDefault) 1539 { 1540 1541 BGrammar * gra = BGrammar::FindByName("Serie"); 1545 int RangeIsDefault, 1546 Tcl_Obj *obj_result) 1547 { 1548 1549 BGrammar * gra = GraSerie(); 1550 1551 if ( !gra ) { 1552 Tcl_AppendStringsToObj( obj_result, 1553 "Serie grammar not found", NULL ); 1554 return TCL_ERROR; 1555 } 1556 1542 1557 scursors cursors; 1543 1558 Tol_SerieGroup * tsg = NULL; 1544 1559 1545 1560 *tsgPtr = NULL; 1546 if (!gra) {1547 Tcl_AppendResult(interp,"grammar 'Serie' not found",NULL);1548 return TCL_ERROR;1549 }1550 1561 1551 1562 tsg = *tsgPtr = Tol_AllocSerieGroup(); … … 1591 1602 continue; 1592 1603 //uts = Tol_GetTimeSerie(interp,series[i]); 1593 uts = (BUserTimeSerie*)Tol_ResolveObject(interp, series[i], GraSerie()); 1604 uts = (BUserTimeSerie*)Tol_ResolveObject(interp, series[i], obj_result/*, 1605 gra*/); 1594 1606 if ( !uts ) 1595 1607 return TCL_ERROR; … … 1599 1611 sername = Tcl_GetString(series[i]); 1600 1612 if (!uts->HasDating()) { 1601 Tcl_Append Result(interp, "\"",1602 sername,1603 "\"does not have dating", NULL );1613 Tcl_AppendStringsToObj(obj_result, "'", 1614 sername, 1615 "' does not have dating", NULL ); 1604 1616 return TCL_ERROR; 1605 1617 } … … 1632 1644 return BadAlloc(interp); 1633 1645 /* por aqui no deberia pasar, REVISALO!!! */ 1634 Tcl_Append Result(interp,"invalid range of dates",NULL);1646 Tcl_AppendStringsToObj(obj_result,"invalid range of dates",NULL); 1635 1647 return TCL_ERROR; 1636 1648 } … … 1645 1657 1646 1658 if (cursors.last==-1) { 1647 Tcl_AppendResult(interp,"the set of serie given have no data",NULL); 1659 Tcl_AppendStringsToObj(obj_result, 1660 "the set of serie given have no data",NULL); 1648 1661 return TCL_ERROR; 1649 1662 } … … 1784 1797 BDate & begin, 1785 1798 BDate & end, 1786 int RangeIsDefault) 1799 int RangeIsDefault, 1800 Tcl_Obj *obj_result) 1787 1801 { 1788 1802 int objc = LstLength(series); … … 1862 1876 return BadAlloc(interp); 1863 1877 /* por aqui no deberia pasar, REVISALO!!! */ 1864 Tcl_AppendResult(interp,"invalid range of dates",NULL); 1878 Tcl_AppendStringsToObj(obj_result, 1879 "invalid range of dates",NULL); 1865 1880 return TCL_ERROR; 1866 1881 } … … 1877 1892 1878 1893 if (cursors.last==-1) { 1879 Tcl_AppendResult(interp,"the set of serie given have no data",NULL); 1894 Tcl_AppendStringsToObj(obj_result, 1895 "the set of serie given have no data",NULL); 1880 1896 return TCL_ERROR; 1881 1897 } … … 2033 2049 break; 2034 2050 if ( i == NTYPES ) { 2035 Tcl_AppendStringsToObj( obj_result, "invalid autocorrelation funtion type '", 2036 type_name, "' must be: ACF, PACF, IACF or IPACF", NULL ); 2051 Tcl_AppendStringsToObj(obj_result, 2052 "invalid autocorrelation funtion type '", 2053 type_name, "' must be: ACF, PACF, IACF or IPACF", 2054 NULL ); 2037 2055 return TCL_ERROR; 2038 2056 } … … 2042 2060 BUserTimeSerie * uts; 2043 2061 //uts = Tol_GetTimeSerie( interp, objv[1] ); 2044 uts = (BUserTimeSerie*)Tol_ResolveObject(interp, objv[1], GraSerie()); 2062 uts = (BUserTimeSerie*)Tol_ResolveObject(interp, objv[1], obj_result/*, 2063 GraSerie()*/); 2064 if ( !uts ) { 2065 return TCL_ERROR; 2066 } 2045 2067 int size_cor = -1; 2046 if ( !uts ) {2047 Tcl_AppendObjToObj( obj_result, Tcl_GetObjResult(interp) );2048 return TCL_ERROR;2049 }2050 2068 if ( objc == 3 ) { 2051 2069 tcl_code = Tcl_GetIntFromObj( interp, objv[2], &size_cor ); … … 2200 2218 2201 2219 // uts = Tol_GetTimeSerie( interp, objv[0] ); 2202 uts = (BUserTimeSerie*)Tol_ResolveObject(interp, objv[0], GraSerie()); 2220 uts = (BUserTimeSerie*)Tol_ResolveObject(interp, objv[0], 2221 obj_result/*,GraSerie()*/); 2203 2222 if ( !uts ) { 2204 Tcl_AppendObjToObj(obj_result, Tcl_GetObjResult(interp));2205 2223 return TCL_ERROR; 2206 2224 } … … 2230 2248 } 2231 2249 if (found == false) { 2232 Tcl_AppendStringsToObj(obj_result, "bad statistics name \"",2233 Tcl_GetString(objv[i+1])," \"", NULL);2250 Tcl_AppendStringsToObj(obj_result, "bad statistics name '", 2251 Tcl_GetString(objv[i+1]),"'", NULL); 2234 2252 Tcl_Free((char*)(stats)); 2235 2253 return TCL_ERROR;
Note: See TracChangeset
for help on using the changeset viewer.
