From: "Hal E. Fulton" Date: 2002-10-22T13:23:37+09:00 Subject: Re: Ruby/Tk newbie question ----- Original Message ----- From: "ursus major" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Monday, October 21, 2002 11:16 PM Subject: Ruby/Tk newbie question > Folks: > A little help, please, with following script: > =============================== > require 'tk' > > def positionWindow(w,x=300,y=300) > geom = '+300+600' #<< why does this work, > #geom = '+', x, '+', y #<< and this NOT work (when uncommented!), > print geom, "\n" #<< when they both print out the same? > w.geometry(geom) #<< the commented statement gives an error > here! > end The commented statement assigns an array to geom. It just happens to look the same when you print it. If you used p instead of print or puts, you'd notice the difference. What you want is something like one of these: geom = "+#{x}+#{y}" geom = "+" + x.to_s + "+" + y.to_s Hal