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



I have been thinking the same thing for years but the whole issue is really
mute now. Programs should be coded with SQL. All these issues vanish and we
get so much more.


On Thu, Nov 1, 2012 at 10:43 AM, Jeff Crosby <jlcrosby@xxxxxxxxxxxxxxxx>wrote:

The reason you don't have level checks in PHP (and similar environments)
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
mess.


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

Follow-Ups:
Replies:

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.