Skip to content
Tcl Source Code Artifact [029c23c57c]
Login

Artifact [029c23c57c]

Artifact 029c23c57c6b243544e1bb835d7409e850490d5e:

Ticket change [029c23c57c] - New ticket [1309482fffffffff|1309482fff] <i>retrieve precise line number in case of error</i>. by nicolascastagne on 2005-09-30 13:22:30.
D 2005-09-30T13:22:30
J assignee msofer
J cmimetype text/plain
J comment When\susing\sTcl\sembeded\sin\sa\sC/C++\sapplication\sin\sorder\sto\s\nexecute\sscripts\swriten\sby\send\susers,\sit\swould\sbe\suseful\sto\s\s\neasily\sdisplay\sbasic\sdebug\sinformation\sto\sthe\suser\sin\scase\s\nan\serror\soccurs.\s\nAmong\sthese\s(and\sas\sminima)\sthe\serror\sline\son\swhich\sthe\s\nerror\soccured.\s\n\s\nToday,\sthe\serrorline\sregistered\sis\snot\ssufficiently\sprecise\sfor\s\na\send\suser.\s\s\n\s\nConsider\sthe\sfollowing\srather\ssimple\sexample\s:\s\n\s\n\s1\s\s\s\sif\s1\s{\s\n\s2\s\s\s\s\s\s\s\sset\sa\s2\s\n\s3\s\s\s\s\s\s\s\sset\sa\s2\s3\s\n\s4\s\s\s\s}\s\n\s\nThe\serror\sis\son\sline\s3.\s\nNow,\sif\swe\shave\sin\sthe\sC\sapplication\s:\s\n\s\n\s\s\s\sresult\s=\sTcl_EvalEx(tclInterp,\sscript,\slength,\s\s\nTCL_EVAL_GLOBAL);\s\n\s\s\s\s\s\s\s\sif\s(result\s!=\sTCL_OK\s)\s{\s\n\s\s\s\s\s\s\s\s\s\s\sTcl_Obj\s*options\s=\sTcl_GetReturnOptions(tclInterp,\s\nresult);\s\n\s\s\s\s\s\s\s\s\s\s\sTcl_Obj\s*key\s=\sTcl_NewStringObj("-errorline",\s-1);\s\n\s\s\s\s\s\s\s\s\s\s\sTcl_Obj\s*errorline;\s\n\s\s\s\s\s\s\s\s\s\s\sTcl_DictObjGet(NULL,\soptions,\skey,\s&errorline);\s\n\s\s\s\s\s\s\s\s\s\s\sprintf("\sERROR\sline\s%s\\n",\sTcl_GetString(errorline));\s\n\s\s\s\s}\s\n\s\nthe\soutput\sis\s"ERROR\sline\s1".\s\n\s\nBasically,\sthe\serror\sline\sis\snot\sretrieved\swithin\sthe\snested\s\nscript\sof\sthe\s"if"\scommand.\s\n\s\nIt\swould\sbe\suseful\sto\sget\s:\s\n-\sthe\serror\sline\s\n-\sthe\sname\sof\sthe\sprocedure\s\nwhatever\sthe\slevel\sof\s'nesting'\sis\sis\sa\sscript.\s\n\s\n------\s\nI\spropose\sthe\sfeature\srequest\son\sthe\sbehalf\sof\sDon\sPorter,\s\nwho\sasked\sme\sto\sdo\sso\son\scomp.lang.tcl\s
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter nicolascastagne
J subsystem 45.\sParsing\sand\sEval
J title retrieve\sprecise\sline\snumber\sin\scase\sof\serror
J type RFE
K 1309482fffffffffffffffffffffffffffffffff
U nicolascastagne
Z 3d52dccdea34226b7903751518801db7