From: Michael Neumann Date: 2001-11-03T08:32:01+09:00 Subject: [ruby-talk:24231] Re: inline comments, IDs Tobias Reif wrote: > Hi, > > How to: > > 1. > I have a long line of code (I know I know ;) ), and want to comment out > a span. > How to write an inline comment with begin and end? Do you think of a comment inside one line of code? 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) Better is to copy the line and comment the duplicate out. Then modify the other. > 2. > ID: something (digits and word characters or whatever) that's guaranteed > to be unique for the time the program runs. (random numbers could be > duplicate) 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! Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de