× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



It won't matter in the long run cause it's just an arbitrary syntactical
thing for the programmer, but the meaning I'm used to is that a semicolon is
the end of an executable statement.  The way I always thought of an if
statement in C that ended in a semicolon like if(Joel ==
Ruler_of_the_Universe); was as a no op because all it does is execute the
comparison and doesn't act on it.  In practice it's the kind of program bug
that can drive you nuts if you intended to act on the result of the
comparison.  It usually involves getting someone else to look at the source.
<g>

Seems to me you have a choice between punctuation with arbitrary rules, or
one statement per line.  If I were doing a lot of C/C++ or Java, I'd hate
moving back and forth between that and free form RPG, though.

> -----Original Message-----
> From: Jim Langston [mailto:jlangston@celsinc.com]
> Sent: Friday, September 21, 2001 1:52 PM
> To: rpg400-l@midrange.com
> Subject: RE: (no subject)
>
>
> Umm.. I'm scratching my head here trying to figure out what you
> are trying to say.
>
> You stated that you didn't like the semi colons at the end of
> if type statements (if, else, etc...) but I'm stating that it's,
> IMO, a better more natural way of doing it.
>
> C doesn't use them for particular reasons that are C's alone,
> being that statements surrounded by braces are treated as one
> statement for many purposes if (condition} {statements}; is the
> if statement syntax, and if you notice there is a semi colon
> required on the end.  That is one statement in C. (Ignoring
> else right now just because)
>
> That condition does not apply to RPG.  In Freeformat RPG the
> syntax is more like (I haven't actually seen the syntax but can
> gather from samples seen):
> if condition;
> statements;
> endif;
>
> That is 3 or more separate statements, not one.
>
> Actually, wasnt' this discussion already had on this list a while
> back?  I believe it should be in the archives, a search for
> "if statement freeformat" should bring it up.
>
> Regards,
>
> Jim Langston
>
>
> -----Original Message-----
> From: rpg400-l-admin@midrange.com
[mailto:rpg400-l-admin@midrange.com]On
Behalf Of Bob Cozzi (RPGIV)
Sent: Friday, September 21, 2001 12:30 PM
To: rpg400-l@midrange.com
Subject: RE: (no subject)


Jim,
I don't buy into the "what's wrong with it" argument. Meaning, you imply
that it is correct and needs justification to prove it wrong.

I don't really mind them; I just think that the "all or nothing" school
of design is lazy. People like me who do not have an $85 Billion/year
company behind them can afford to do certain things in an all or nothing
way. But when it impacts billions and billions of lines of code, it
should be done correctly.

Again, as I said, I don't mind it being confusing, after all, I doubt
most people will use the free form stuff in production. Now that doesn't
mean that 100 percent will NOT use it. I'm sure 100 two 200 RPG
programmers will use it. Most of them are on this list or my list. But
the vast majority of people won't bother with it. Why do I think this?
Because they already know RPG III or RPG IV and to them, those languages
are good enough.

Case in point, most people would love to have a built-in function to
convert character values (with decimals) to numeric. But we have 5 or 6
ways of doing the ADD operation in RPG instead. I guess the fixed format
ADD was too hard to use. <g> (Just kidding on that one.)




Bob Cozzi
cozzi@rpgiv.com
Visit the new on-line iSeries Forums at: http://www.rpgiv.com/forum


_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.