From: Phlip Date: 2004-09-24T10:54:32+09:00 Subject: rb_eval_string_protect with correct error line number Rubies: rb_eval_string_protect() calls eval(), so at error time $ERROR_POSITION ($@) gives me a useless number. I want the line number (and preferably the column number) of the offending part of the evaluated string. Raw Ruby does that like this: stwing = """ puts 'a' puts undeclaredVariable puts 'c' """ begin eval(stwing, nil, "yo", 0) rescue p $@ end That outputs ["yo:2"] How can I get the correct error line number, using the equivalent of eval()'s last two optional parameters, without converting my string to a Ruby string and then calling "eval" on it? -- Phlip http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces