From: Dave Burt Date: 2006-03-27T20:18:54+09:00 Subject: Re: WIN32OLE#[] and WIN32OLE#[]= method in Ruby 1.9 (or later) Hi again, Masaki Suketa wrote: > In message "Re: WIN32OLE#[] and WIN32OLE#[]= method in Ruby 1.9 (or > later)" > on 06/03/25, "Dave Burt" writes: > >> > record.setproperty("StringData", 1, 'dddd') >> >> record[:StringData][1] = 'dddd' > > Thank you. It is very interesting. > I think about it. It's not ideal, but WIN32OLE doesn't use Symbols - VBScript and JScript don't have them. We're trying to match this VBScript, right? record.StringData(1) = "dddd" As far as I understand, we can't make record.StringData(1) = "dddd" or record.StringData[1] = "dddd" work while keeping the same dynamic call functionality we already have (StringData should be called as a method in both cases) but what about another option: record.StringData{1} = "dddd" The rule would be similar to the above, but instead of looking for a symbol, you're looking for block_given? and using "yield" as the index/parameter to the property. Although, in a sense, this matches semantic-for-semantic less than the [:StringData] version, and that's what I like best about the change you're suggesting - use Ruby's index operators for the same purpose in OLE. Thanks again for your efforts on this project, Dave