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



Hi Booth,
 
<snip>
I am not sure what you mean by a crappy implementation. One line to define
the file to be used seems fairly simple to me.
</snip>
 
When I say crappy I mean the way VARPG handles stream files is totally
inconsistent with the way RPG handles stream files. It also seems a little
clunky to me.
 
 
<snip>
Of course, too, remember that the target audience for VARPG is RPG
programmers, not UNIX gurus or c++ programmers. So, making it like UNIX or
c++ is not a goal for VARPG. If someone wants to use UNIX or c++, by all
means, do so. No reason not to. But please don't obfuscate how I make a
living in the process.
</snip>
 
My point is simply that the way VARPG handles stream files is far less like
the way RPG handles them than C is. 
 
In "The C Programming Language" by Kernighan and Ritchie a standard way to
open a stream file via the unix interface is described as follows:
 
fd = open(name, O_RDONLY, 0);        // page 172 of the second (ANSI C)
edition
 
In "Who Knew You Could Do That with RPG IV? A Sorcerer's Guide to System
Access and More" by Smith, Barbeau, Gantner, Paris, Vincetic and Zupka a
standard way to open a stream file via the unix interface is described as
follows (paraphrased slightly): 
 
FileDescI = open(%trimr(inputpath) : O_RDONLY + O_TEXTDATA);        // page
275, section 6
 
Now, what about VARPG? How does it open a stream file? No brainer right?
It'll obviously do it the same way RPG does. Wrong! It uses F-specs. To me
THAT is obfuscation. To me it seems like the VARPG compiler was written by a
team of C++ programmers who had never used RPG, but had been told many tales
about dumb RPG programmers who can't access any file system unless they have
an F-spec chisseled out in stone for them. I think we are much better than
this. I agree that F-specs for accessing database data was a fantastic
invention, and if we didn't have other easier ways of accessing stream files
then I may think it is a good idea to use F-specs in RPG and VARPG. But RPG
already has the unix system interface (or some OS/400 equivalent) and it is
very, very easy to use. So why did they implement something completely
different in VARPG?
 
 
<snip>
You may like the idea that RPG is beginning to look like every other
language, but many RPG programmers don't see the big advantage of mucking up
what has worked well for a very long time.
</snip>
 
But that is my point - I'm not talking about mucking up RPG - it already has
the interface for working with file descriptors. This works really well.
VARPG does NOT work with stream files in the same way RPG does. So why did
they make VARPG handle stream files in a way which is inconsistent with the
most ubiquitous client-side languages (C/C++) and the language the
programmer is most comfortable with (RPG)? I'd probably have an easier job
converting my RPG stream file code to C than to VARPG. :-)
 
Thanks to the unix system interface I can easily work with file descriptors
(this also includes sockets) in RPG. I have spent more time in the last two
years working with stream files than I have with printfiles. If I wanted to
port my code to the PC and use VARPG I'd have to re-write all of my code
which handles stream files. That, to me, is crappy. <shrug> Dumping stream
file F-specs in VARPG if favour of file descriptors is not making it more
like C it is making it more like RPG.
 
Finally, I am 35 and can easily expect to still be programming in 2030, and
when I get there I really don't expect to be programming in fixed format RPG
IV. So I assume that, like the RPG language itself, I have to evolve to meet
the demands of emerging markets. Handling stream files with the use of
F-specs is not something I thought I'd ever need to learn. :-)
 
Cheers
 
Larry Ducie

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.