From: Tobias Reif Date: 2001-11-03T08:37:28+09:00 Subject: [ruby-talk:24232] Re: inline comments, IDs Michael Neumann wrote: > Do you think of a comment inside one line of code? yep This is not really > possible. But you could do it as follows: > > before: > 3 + 4 + 5 + 5 - 4 - 5 > > after: > 3 + 4 + (%{5 + 5 - 4}; - 5) OK > Better is to copy the line and comment the duplicate out. Why? Then modify > the other. > Simply start with a string (or integer) of an arbitrary length (e.g. > "dlkjddfdfd"), then each time you want to generate a new ID, simply call > aString.succ! Just thought of that; a simple counter + ~ format("%09.0f", counter) ... Thanks for all the good advice. I'm already excited about your book ;) Tobi -- Tobias Reif http://www.pinkjuice.com/myDigitalProfile.xhtml go_to('www.ruby-lang.org').get(ruby).play.create.have_fun http://www.pinkjuice.com/ruby/