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



Hello,

IMHO Thomas is absolutely right!

LASO Software GmbH
Bernd Dworrak, Dipl.-Phys.

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von thomas.raddatz@xxxxxx
Gesendet: Dienstag, 8. Oktober 2013 08:40
An: rpg400-l@xxxxxxxxxxxx
Betreff: Re: Free format H, F, D and P specs


I almost agree with Alan. Although I do not necessarily need a new compiler I think that IBM again missed a good chance to really modernize /free. For example from the day when IBM introduced procedures with V3, I wonder why we have to use P specs to start/end a procedure and D specs for the procedure interface. Using only P specs whould have been a lot easier and clearer (at least for me):


Prototype:

P startsWith...
P P N
P i_prefix 4096A const varying
P i_string 4096A const varying


Implementation:

P startsWith...
P B N export
P i_prefix 4096A const varying
P i_string 4096A const varying
/free

/end-free
P E

I do not believe that having done it this way would have have been much more expensive.

What I want to say is that on my opinion IBM tends to stay to close to the old things. IBM prefers using START/END tags where other languages uses brackets which are often clearer to read. For example:

ctl-opt dftactgrp(*no);
ctl-opt main(main);

dcl-proc main(caller_name char(10) const) {

dcl-c RECORD_LEN 80;
dcl-f qprint printer(RECORD_LEN);

dcl-ds prtDs len(RECORD_LEN) qualified {
*n char(6) inz('Hello'),
name char(50),
};

prtDs.name = transform(caller_name);
write qprint prtDs;

*inlr = '1';

dcl-proc varchar(50) transform(
name varchar(10) const options(*trim)) {
return '*** ' + name + ' ***';
};

Actually there is no need for 'dcl-pi'. There are only procedures and the main procedure is indicated by 'ctl-opt main(main)' or even just by name:
'main'.

I do not know much about building professionell parsers and compilers but I do not think that my example would have been that much expensive.
'dcl-proc' is the same and instead of 'end-proc' the compiler had to look for the closing curly bracket. 'dcl-pi' and 'end-pi' are replaced by brackets, too.

Just my two cents.

Thomas.

PS: Here is what I actually wished to get:

options dftactgrp(*no), main(main);

procedure main(caller_name char(10) const) {

const RECORD_LEN 80;
file qprint printer(RECORD_LEN);

structure prtDs len(RECORD_LEN) qualified {
*n char(6) inz('Hello'),
name char(50),
};

prtDs.name = transform(caller_name);
write qprint prtDs;

*inlr = '1';

procedure varchar(50) transform(
name varchar(10) const options(*trim)) {
return '*** ' + name + ' ***';
};

This is the RPG programming on the IBM i (AS/400 and 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.



--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender.
--
This is the RPG programming on the IBM i (AS/400 and 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.

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.