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



I mistakenly coded %Error() (with parenthesis) rather than just %Error. I
was surprised when there was no compile error. I checked the RPG manual and
%Error() was not found. I also checked the list archives but couldn't find
this specific question.

If I look at %Equal it may also be used as %Equal{(filename)} where %Equal
(without parenthesis) refers to the most recent relevent operation. Adding
a filename makes %Equal specific to the file.

If I code %Error(filename) I get a validation error. I expected the same if
I just code %Error().
Is this undocumented that %Error and %Error() are the same thing?

I coded two test programs to test this.

* TEST0001 - Call this program first to lock the record
H Option(*nodebugio)
h DftActGrp(*NO) ActGrp(*NEW)
fWFRCD UF E K Disk
d rc s 1a
/Free

*inlr = *on;
Chain(e) (1362397 : 1) WFRCD;
If %Found(WFRCD);
Dsply 'Record Locked' ' ' rc;
Else;
Dsply 'Record NOT Locked';
Endif;
/End-Free

* TEST0002 - Call this program second on a second session
H Option(*nodebugio : *srcstmt)
h DftActGrp(*no) ActGrp(*new)
fWFRCD UF E K Disk
/Free

*inlr = *on;
Dou not %Error();
Chain(e) (1362397 : 1) WFRCD;
If %Error;
Dsply 'Record Locked';
Else;
Dsply 'Record NOT Locked';
Endif;
Enddo;
Dsply 'Out of record lock loop';
/End-Free

If I change the %Error() at the top of the Dou loop to just %Error they work
the same.

Does anyone have any comments as to why and it is acceptable to code
%Error()?

Thanks,

Rob

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.