× 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.


  • Subject: Using reserved words as variable names WAS: CF-Spec - another call for opinions
  • From: Buck Calabro <mcalabro@xxxxxxxxxxxx>
  • Date: Thu, 12 Aug 1999 11:34:57 -0400

John,
I completely agree with you and Colin that breaking a working program is not
the best course of action that a compiler writer can take, but I think that
the risk of doing that in RPG IV is a vanishingly small one.  Here are the
opcodes added by release (I culled them by comparing the online manuals.  I
may have missed one):

V3R6:
CALLB, CALLP, DOU, DOW, EVAL, EXTRCT, IF, WHEN
V3R7, V4R1:
ALLOC, DEALLOC, REALLOC
V4R2, V4R3:
*none
V4R4:
EVALR

BASIC doesn't need LET X=1, why should RPG IV need EVAL X=1?

If we could use the SQL convention to distinguish between a reserved word
and a variable, I think that the impact would be very minimal, because we
wouldn't have to rename our newly ambiguous fields, merely put quotes around
them.  Editor "scan and replace" makes that fairly painless, and we wouldn't
have to worry about trying to rename database fields, either.

As far as *BLANK goes, I can't tell you the number of times I've coded a CL
line like this: IF (&INPUT *EQ *BLANKS) DO(...)  and wondered why the darned
thing didn't work right.  The 400 is already a multi-language box, and we
already have one convention for dealing with reserved words (in SQL) - why
not re-use that?

Very humbly,
Buck Calabro

> -----Original Message-----
> From: John P Carr 
> Sent: Thursday, August 12, 1999 8:34 AM
> To:   RPG400-L
> Subject:      RE: CF-Spec - another call for opinions
> 
> Colin said;
> >I beg to differ. Having to change source on an upgrade is a very big
> >deal. Thats the sort of thing that prevents people from upgrading!
> 
> I can see it now,  2-3 years after the CF's are in,   a person goes into 
> a source member, makes a one line change,  and the compile listing 
> tells her/him  that they have to change a half dozen variable names 
> because "now" they are keywords. 
> 
> "It used to work,   Now it don't ,   What the @#$%@ did they do? "
> 
> One thing about *ON, *OFF, *ZERO, *BLANK    You never confused them
> with your variable names.
> 
> John Carr
> 
> 
> 
> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator:
> david@midrange.com
> +---END
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---END



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.