Re: newbie question on cobol syntax




"LX-i" <lxi0007@xxxxxxxxxxxx> wrote in message
news:_N6dnZOqIvKHN7PbnZ2dnUVZ_vWtnZ2d@xxxxxxxxxxxxxx
Howard Brazee wrote:
On Mon, 23 Apr 2007 20:20:50 -0600, LX-i <lxi0007@xxxxxxxxxxxx> wrote:

It does. That is, the Cobol standard does avoid such tricks and
specifies that the above does not comply. It is only some vendors that
allow such tricks.
I was thinking that it was forbidden per the standard. I guess I
haven't been out of the scene for that long... :)

Which is why in my first message of the thread mentioning this
possibility, I said:

Some compilers will allow

I remember - but I also remember thinking, then, that telling a newbie
about a dangerous feature allowed by some compilers, might not have been
the best direction to take the conversation. (Kind of like telling
someone to overrun their table index if they needed more memory - sure,
it'll work, but it's not the right way to do it.)

But, it wasn't my conversation, so I stayed out... :) Today, I was
coding away at my new Java job, and found myself creating a setter
method...

public void setDescription(final String psDescription) {
move psDescription to msDescription
}

I got to the "c" in "msDescription" and realized what I was doing!
Oops...


Wait 'til you start writing (in COBOL...)

wsvalue = ws-number.ToString(); :-)

It took me about two weeks of intensive coding in C# before I stopped making
the kind of error you describe...

These days it doesn't happen... :-)


Pete.


.