I don't know if this is too C-ifying it (as in the language, not the
spec), but you could do something like this:
main{
}
[export] myProc (7p,2)( varName: 10a, varNum: 10i ){
}
Just looking to cut down on extraneous words.
Instead of brackets, you could do:
[export] myProc (7p,2)( varName 10a: varNum: 10i );
end myproc;
D-spec could look like this:
define varName(10a);
define varNum(10i) = 5;
or
varNum 10i = 5;
Though maybe it's easier for the compiler to see the type first:
varNum1 p3,1;
Or even
p varNum1 3,1;
a varName 10;
Sounds like a lot of work for them to do this. But I'd be pretty happy
to see something like this. I'd love to see overloaded procedures with
this as well. However you need to be backward compatible, so keywords
such as *nopass and *varsize still need to be allowed somehow.
Kurt Anderson
Application Developer
Highsmith Inc
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of albartell
Sent: Friday, October 05, 2007 8:53 AM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Free Format Procedures
I have debated this topic in my mind and am wondering what other people
have for thoughts. If sub proc definitions were made to be free format
(and inherently D specs for the sake of doing it right), how would the
syntax work? The issues I see are determining how to deal with all of
the keywords and data types. Actually, I don't mind the fixed format of
D specs, I just don't like /free and /end-free in the mix.
begsp export 65535(varying) doProcess(var1 i: var2 50a: var3 15p,0);
endsp;
Thoughts?
Aaron Bartell
http://mowyourlawn.com
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Kurt Anderson
Sent: Friday, October 05, 2007 8:44 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Free Format Procedures
Honestly 99% of the time I copy and paste the header and footer block of
a procedure, so I'm never really ever typing out the /free compiler
directives. We also begin our procedures with a comment explaining the
parameters and additional notes about the procedure if needed, so
copying also allows that documentation format to be standard. Do you
find that you type it out every time?
Kurt Anderson
Application Developer
Highsmith Inc
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael Ryan
Sent: Friday, October 05, 2007 8:24 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Free Format Procedures
Thanks...I didn't think there was (I've been coding /free for a long
time), but I'm always open to getting smarter. Plus, the program I'm
coding has a ton of procedures in it, so it became somewhat more
irritating this morning.
Maybe cause it's Friday.
On 10/5/07, Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx> wrote:
From: Michael Ryan
Maybe there's a cool way and I just don't know, so I thought I would
ask. What's the technique for using /Free and /End-Free with free
format in procedures? Like this?
/End-Free
P doProcess B
D doProcess PI
/Free
<free format code>
/End-Free
P doProcess E
Or is there a better way? Thanks!
Nope, that's all you can do. Today, /free only includes C-specs; the
P- and
D- specs must be fixed format, and since every procedure needs P- and
D- specs, that means you have a lot of /free and /end-free, especially
if you write lots of little routines.
One shortcut I use (and this is entirely a style thing; some people
won't like it because it's not "self-documenting" enough) is that the
procedure interface (D-spec type PI) and the procedure end (P-spec
type E) don't need to have the procedure name repeated.
/End-Free
P doProcess B
D PI
/Free
<free format code>
/End-Free
P E
Thus I only have the procedure name on two lines: the prototype and
the procedure begin. But that's just me.
Joe
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.