On Apr 30, 6:06=A0pm, 7stud -- <bbxx789_0... / yahoo.com> wrote:
> RichardOnRails wrote in post #995908:
>
> > I know my Subject line looks like heresy in this newsgroup, but I
> > can't figure out how I'm screwing up in this bug.
>
> > I posted the program athttp://www.pastie.org/1849430
> > It reads in a little control data, which is displayed at
> >http://www.pastie.org/1849434
>
> > The program reads in the control data and stores it in hash containing
> > two hashes in this case, which represents the two pseudo-hashes in the
> > control data.
>
> > My problem is conflicting output by the statements numbered 155 & 156:
> > =A0 =A0 puts %[%d\t%s =3D> %s] % [num+=3D1, key, value]
>
> I know about ruby's % substitutions, but I can't decipher that line--you
> have obfuscated the code very well! =A0Not a good thing. =A0 I would writ=
e
> that line as:
>
> puts "%d\t%s =3D> %s" % [num+=3D1, key, val]
>
> lol. =A0You are using the % shortcut for %Q and you are using [] as the
> delimiter. =A0I have only one thing to say: horrible code writing.
>
> --
> Posted viahttp://www.ruby-forum.com/.

Hi 7Stud,

Thanks for your response.  As I mentioned to Mike, I had more serious
things to work on last
week; hence, my belated response.

>> puts %[%d\t%s =3D> %s] % [num+=3D1, key, value]
vs.
> puts "%d\t%s =3D> %s" % [num+=3D1, key, val]

I used %[...] instead of "..." because I often want to include
embedded double-quotes in my strings and believe my delimiting
approach is clearer since I don't have to escape double-quotes.
Nevertheless, I'm mindful of the ancient adage, de gustibus non est
disputandum.

As I also mentioned to Mike,  I now realize that my parsing routine
produced errors in in my control data.  Rather than trying to correct
my amateurish code,  I'm going to study one of Ruby Design Patterns
for application to this problems.

Best wishes,
Richard