Menu

#480 get current line number during source command execution

closed-fixed
5
2007-07-18
2007-07-17
No

During the execution of a user / registered command I need to report about an issue (which is not an error) and provide the script file name and line number if the command is inside a script file. The Tcl_Interp errorLine member variable is updated only if the command returns TCL_ERROR code, otherwise I can't see any way to find out the current line number.

Discussion

  • Andreas Kupries

    Andreas Kupries - 2007-07-17

    Logged In: YES
    user_id=75003
    Originator: NO

    Is TIP #280 (http://tip.tcl.tk/280) what you are after ?

    If yes, then you have this in Tcl 8.5, and in Activestate's ActiveTcl 8.4.

     
  • Israel Taller

    Israel Taller - 2007-07-18

    Logged In: YES
    user_id=377302
    Originator: YES

    Thanks Andreas. Yes, this is what I need, but I need to get the line number information from C. I guess I will be able to get this after looking at the Tcl source code... We are still using Tcl 8.4 so looks like we need to use Tcl 8.5 in order to access this functionality.

     
  • Andreas Kupries

    Andreas Kupries - 2007-07-18

    Logged In: YES
    user_id=75003
    Originator: NO

    Tcl_Eval ("info frame") and similar code.

     
  • Israel Taller

    Israel Taller - 2007-07-18
    • status: open --> open-fixed
     
  • Israel Taller

    Israel Taller - 2007-07-18

    Logged In: YES
    user_id=377302
    Originator: YES

    Looks like this is available in 8.5, but a C API to get this info would be nice to have.

     
  • Israel Taller

    Israel Taller - 2007-07-18

    Logged In: YES
    user_id=377302
    Originator: YES

    Close this issue.

     
  • Israel Taller

    Israel Taller - 2007-07-18
    • status: open-fixed --> closed-fixed