|
The reason you don't have level checks in PHP (and similar environments)mess.
is because they don't have hard-coded from/to positions in fields in the
record. When you compile an RPG program, the compiler reads the
external definition, and hard-codes the from/to positions of fields in
the record into the program. You have to recompile for it to update
these -- and therefore, level checks are an important safeguard. Without
them, if the file changes, you'll end up reading (or worse, writing)
incorrect data at incorrect places in the record, causing a big huge
Scott's post got me thinking.
Theoretically, could RPG be enhanced such that the from/to positions are
_not_ hard-coded at compile time? Instead, based on field name (whether
renamed or not), the from/to positions would be established at run time.
If so, one would also have to code updates properly, i.e., either via
"Update RecordName %Fields(blah:blah:blah);" or making sure the O specs
have no end position.
Even though I have absolutely no experience whatsoever in compiler writing
(and don't want any), I can imagine how this would fundamentally affect the
compiler.
--
Jeff Crosby
VP Information Systems
UniPro FoodService/Dilgard
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531
www.dilgardfoods.com
The opinions expressed are my own and not necessarily the opinion of my
company. Unless I say so.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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 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.