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




On Fri, 5 Apr 2002, Joel Fritz wrote:

> This looks really cool.  Thank you very much.  I'm going to try it out as
> soon as I can.

Actually, I just noticed a flaw in it.  (I laughed pretty hard when I
saw this one)  Look at this code:

> >      C* Ack! Something foiled my plans!
> >      c                   if        Msg <> *blanks
> >      c                   for       x = 0 to 2
> >      c                   callp     close(x)
> >      c                   dsply                   msg
> >      c                   eval      *inlr = *on
> >      c                   return
> >      c                   endfor
> >      c                   endif

Cool, huh?  I'm exiting the program in a loop. :)   The "endfor" should
actually be after the "callp" and before the "dsply".   Oh well :)


> My motivation was that a co-worker was looking for a way to call java
> programs from RPG interactively (v4r5) without having to deal with closing
> the QSHELL session, which I think QzshSystem will do.  I bought him off with
> doing the calls in a submitted job.

Isn't that what RUNJVA is for?  (I may be completely off-base, I don't use
java from OS/400 at all.)


> I do understand the C origins of the Unix type apis.  The file apis, for
> example, are pretty much the same as standard C low level file I/O.  I'd
> just love to see some RPG examples to get an idea how to handle the things
> that are more difficult than the data type conversions.  Remember Simon's
> fun with printf()?

I wish it was that simple.  For anything more complicated than the data
type definitions, there usually isn't a "one-to-one mapping".

What I generally do is look at what the C code does, and think to myself
"how can I get the same output in RPG?"  It doesn't matter if the routine
uses the exact same steps to accomplish it, as long as the input and
output are the same.  Of course, being proficient with both languages helps :)

Obviously, the problem with printf() is that it can have ANY type of
arguments, passed by value, and you don't know what they'll be at the time
you're writing the prototype.  (Unless of course you write a separate
prototype for each use of printf, in which case it works just fine from RPG)

> In order to convert the Unix people, someone has to tell them the apis
> exist.  <g>

Yeah, that's IBM for you.  Great technical solutions, lousy marketing.
But that's a whole different topic, one that's been beat to death...




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.