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



Yes, that is the programming error and resolution. It was intentional, to point out that an undefined variable caused an erroneous compiler error statement; that the procedure was claimed undefined when it was present in the source.

On Apr 20, 2010, at 15:44, Robert Rogerson <rogersonra@xxxxxxxxx> wrote:

Loyd, isn't the problem that the call of execcmd is called with the first
parameter (command) which is undefined does not match the prototype?

Rob

On Tue, Apr 20, 2010 at 2:01 PM, Loyd Goodbar <loyd@xxxxxxxxxxxxxx> wrote:

Not a showstopper by any means, more out of morbid curiousity. RPGLE V5R4
(but may still exist at higher versions). Consider the example program:

d ExecCmd pr extpgm('QCMDEXC')
d CmdString 3000a const options(*varsize)
d CmdStringLen 15p 5 const
d CmdOption 3a const options(*nopass)
/free
command = 'ovrdbf file(myfile) tofile(loyd/myfile)';
execcmd(command:%len(%trim(command)));
*inlr = *on;
return;
/end-free
There is an intentional syntax errror: the variable "command" is not
defined. The gist is using a prototyped call. QCMDEXC and the command to
execute are arbitrary and serve as examples only.

When compiled, these messages are generated:
*RNF7030 The name or indicator COMMAND is not defined. [expected]
*RNF7503 Expression contains an operand that is not defined. [command=...]
*RNF7503 Expression contains an operand that is not defined. [execcmd(...]
*RNF5410 The prototype for the call is not defined. [Huh??]

Why does RNF5410 occur? The prototype definitely exists. Without it, these
compile messages occur:
*RNF7030 The name or indicator COMMAND is not defined. [expected]
*RNF7030 THe name or indicator EXECCMD is not defined. [expected]
*RNF7503 Expression contains an operand that is not defined. [command=...]
*RNF7503 Expression contains an operand that is not defined. [execcmd(...]

The RNF5410 is just out of left field to me. I'm curious as to the
rationale
of this erroneous (in this instance) error. Is the compiler saying that
because an argument is not defined, it can't execute the prototyped call?
That makes more sense to me than saying the prototype does not exist.

--Loyd
--
This is the RPG programming on the IBM i / System i (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 IBM i / System i (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.