× 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: A short program
  • From: "David Morris" <dmorris@xxxxxxxxxxxxx>
  • Date: Mon, 12 Apr 1999 13:44:15 -0600

Hans,

The following RPG program will list itself and is probably cheating. 
Compile SHORT with DBGVIEW(*SOURCE).

     C                   CALL      'QCMDEXC'                            LR
     C                   PARM      'STRDBG SHORT'CMD              12
     C                   PARM      12            LEN              15 5

David Morris

>>> <boldt@ca.ibm.com> 04/12/99 10:02AM >>>


Dave wrote:
>>I don't mean to nitpick, but you've beaten my 29 line
>>program by only 5 lines.  This is a 24 line program
>>since the blank line at the end of the program is significant.
>>(Your program writes 2 times 12 records.)
>
>No, Hans, it's a 23 line program. Although the compile time array has 12
>entries and all are used, only the first 11 are included in the source.
The
>compiler gives a severity level 0 error QRG8042, but is otherwise happy.
>
>You could argue that the printed output contains a 24th blank line that
>isn't in the source, but that _would_ be nit-picking as the blank line is
>indistinguishable from the rest of the white space on the printed page.

White space is not indistinguishable to a computer!

But the point is moot since my colleague Barbara has cleverly
beaten us both with a 13 line program!  I'll post the source
code tomorrow to give you a chance to ponder how she did it.
The program uses ILE RPG, but we're not sure if the approach
is even possible in RPG III.

Cheers!  Hans

Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com 


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


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.