|
Hello Bob,
You wrote:
>And why aren't we using the 'QtmhGetEnv' API to Get the environment?
>I realize it takes a bit of research to get it working, but I'm just
>wondering.
Geert was attempting to use getenv() so I showed him how. There is no
reason why the QtmhGetEnv API could not be used if you prefer it. Neither
method is harder than the other. However,
C CALLP QtmhGetEnv( classPath :
C %size(classPath) :
C returnLength :
C 'CLASSPATH' :
C 9 :
C Qus_Ec )
is a lot uglier than
C EVAL @envVar = getenv('CLASSPATH')
C EVAL classPath = %STR(@envVar)
To make it nicer would involve encapsulating the QtmhGetEnv API in a
procedure which means increasing the work required -- especially if you do
it properly and use operational descriptors to determine the string
lengths. getenv() already exists and does the job quite well with much
less work -- although it does require the use of a pointer (which as we
discovered earlier makes it far too complex for the average RPG coder to
comprehend :-).
QtmhGetEnv would be an ideal solution for RPG III and other languages
without pointer and null-terminated string support or for people with an
aversion to pointers -- didn't your Mother teach you that it was rude to
point?
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software AS/400 Technical Specialists
http://www.flybynight.com.au/
Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\
Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.