Hi, 

From: Craig Files <craig_files / agilent.com>
Subject: Re: TCL interpreter in Ruby?
Date: Wed, 1 May 2002 07:06:11 +0900
Message-ID: <pan.2002.04.30.15.50.32.767793.2269 / agilent.com>
> Getting the errorInfo variable is a great idea, but I cannot find a  
> a method Tk.something(var).  I have done a grep on the ruby source 
> code (both 1.6 and 1.7) for GetVar and have found nothing.  

Please use TkVarAccess class. For example, 
---------------------------------------
v = TkVarAccess.new('errorInfo')
begin
  Tk.tk_call('source', file)
rescue
  msg = v.value
  /\(file ".*" line (\d+)\)/ =~ msg
  err_line = $1.to_i
  print 'error on line ', err_line, "\n"
end
---------------------------------------

> I have also tried to use tk_call() in ruby to print errorInfo, but the 
> following does not print out the data in errorInfo:
> Tk.tk_call('set','errorInfo')

Need print method, because it returns errorInfo value as a string. 
You will be able to get same value of TkVarAccess.new('errorInfo').value.
-- 
                                  Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)