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



Jim Langston wrote:

>There are somethings I would like to ask 
>about programming in RPG to do things 
>better, but I don't really believe people 
>would like this forum filled up with what 
>they may consider non-essentials.

<typing gently> Asking how TIME works is non-essential: It's easily found in
the manual.

>Such as, I just wrote a program to calculate 
>the check some on a container, and it works
>fine, but it is, in my opionion, a bit sloppy.  

Now THIS would make a great thread!  Why don't you post the code and let's
watch the open source concept go to work?

>I couldn't remember how to call the power function
>(I'm sure it's in QC2LE, is it POWER or POW?) 
>so I wrote my own power function,

All the C type functions are documented in the C library manual.  In this
case, you're looking for pow.
h debug dftactgrp(*no) actgrp('QILE') bnddir('QC2LE') 
d double          s              8f
d pow             pr                  extproc('pow') like(double)
d  xin                                like(double) value         
d  yin                                like(double) value         

>I used subroutines instead of functions, so I need 
>to get them converted, then I want to stick it in a 
>library, either a bindable module or a linkable module, 
>not sure which right now, because if I'm using QC2LE 
>as my bind, can I have another one?

Terminology is not going to make this easy!
You can bind by copy (your linkable module?) or bind by reference (IBM's
service program; your bindable module?)  Generally speaking, you would bind
by copy only if you intend to use the function in one or two programs.  Bind
by reference is more typical when you intend to use the function in many
places.  
ILErs tend to deal with the source like the C folks: make a header file
containing the prototypes and include (/COPY) it into the programs where
they're needed.
As for the next steps, I think a reasonable transition from RPG II style to
RPG IV would be something like this:
Keep the EXSR's
Change the subroutines to do a callp instead of the current calcs
Build your procedure by including all source (PR and PI) in the program that
needs it
Compile with   h debug dftactgrp(*no) actgrp('QILE') bnddir('QC2LE') 

This keeps your existing code intact (exsr power) while introducing you to
elements of ILE.

Great idea for a discussion thread!

Buck Calabro
Aptis; Albany, NY
"We are what we repeatedly do.
 Excellence, then, is not an act, but a habit." --Aristotle


Billing Concepts Corp., a NASDAQ Listed Company, Symbol: BILL
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.