× 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: RPG-CGI for the AS/400
  • From: "Joe Teff" <jteff19@xxxxxxx>
  • Date: Tue, 16 Nov 1999 19:49:57 -0600

>  >> And not using EXTPROC either,
>
>  You've lost me here Brad - you sound proud of the fact that you didn't
use
> protos and I don't understand why. They simplify the call, allow you to
use a
> meaningful name, support optional parameters, deal with mismatches in
length,
> etc. etc. Do you have something against them?


I used Brad's articles in MC as a basis for doing the same thing. All of the
actual calls to the APIs are in subprocedures in a service program. The
application programs now use prototypes to my subprocedures which use
a minimum of parameters and easy-to-remember names. I am teaching
other AS/400 developers to do CGI programming with RPG IV and they use
procedures like

           cgiRead( data )
           cgiCvt( data : ds : 'filename' : 'libname' )
           cgiWrite( data )
           cgiGetUser( user )
           cgiGetParms( data )

These developers don't need to know that I'm using C APIs like QtmhWrStout,
QtmhRdStin, QtmhCvtDb and QtmhGetEnv.

I also have short-cut procedures to help build HTML. For example

           cgiGetSource ( 'libname' : 'srcfname' : 'mbrname' )

will cause all records in that source member to be written to Standard Out.
This
enables me to put static HTML code in tables instead of inside programs.
It's also
easy to maintain them with SEU. I have other shortcuts like

           cgiFormTblRowInp( 'Item Number' : 'ITEM' : %EditC( ITEMNO : '3')
: '6' )

that would create html like (assuming ITEMNO contained 123)

           <tr>
           <td>Item Number:</td>
           <td><input name="ITEM" type="text" value="123" size="6"
maxlength="6"></td>
           <tr>

Joe Teff

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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 ...

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.