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


  • Subject: Re: prototypes and functions
  • From: Rob Berendt <rob@xxxxxxxxx>
  • Date: Fri, 4 Feb 2000 9:01:13 -0500

One little thing though.  If you plan on using service programs in 
the near future, you might want to consider using /copy for your 
prototypes which may be used in more than one program.




jlangston@conexfreight.com on 02/03/2000 05:54:14 PM
Please respond to RPG400-L@midrange.com@Internet
To:     RPG400-L@midrange.com@Internet
cc:      
Fax to: 
Subject:        prototypes and functions

Actually, this post explained it quite well, and gave me all the pieces I
need to put my own together.  It is basically the same as in any
programming language, such as VC++, VB, Delphi (Pascal), etc...

The pieces in all these languages are this:
1. Give a prototype of the function to be called, including all the
   parameters to be passed, and any returning parameters.  Put
   this at the top of the program so it is one of the first lines found.
2. Code the main program, calling the procedure as needed.
3. Code the function, giving the parameters to be passed (once
   again, yes, this is done twice) and any return parameters.
4. Code any local variables to be used in the function
5. Code the logic
6. Code the return value

3 through 6 are, in effect, a program unto them selves.  They just
reside in the main source file.

1 is done to allow the compiler to perform as few passes as possible.
It is not done for us, but for the compiler.  So it knows what the
function is going to look like when it hits a call to it in the main line.

This is an excellent boiler plate, thanks a lot! It gives me all the pieces
I need.

Regards,

Jim Langston

boothm@earth.Goddard.edu wrote:

> Hans, I'd love to use the example in this post but I don't understand it.
> Learning them out of book is not easy.  This is a good example.  Simple
> process and clearly explained yet I have no idea where to even start.
>
> Now, I am aware that I'm not a boy genius, but I also know I am not the
> stupidest RPG programmer in the world.  This stuff is not as easy to learn
> as you guys think.  In my experience, the examples start at about Chapter
> 3.
>
> Remember how Coach Lombardi started every season?  "Gentlemen, this is a
> football."
> _______________________
> Booth Martin
> boothm@earth.goddard.edu
> http://www.spy.net/~booth
> _______________________

+---
| 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
+---


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