× 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: genuinely stupid programming illustrating subroutine simulation with GOTO
  • From: Joel Fritz <JFritz@xxxxxxxxxxxxxxxx>
  • Date: Thu, 8 Apr 1999 11:28:11 -0700

Some of you folks just don't have a very good sense of humor (i.e. like
mine.) <g>
Here's a really cool bit of coding.  I'm sure there's someone out there who
could reduce it to 3 lines or fewer or obfuscate it even further. 

As it stands, it seems to run real fast, though.

        *************** Beginning of data
************************************************************
0002.00      C                     MOVEL'CALL1'   LOC     6
990407   
0003.00      C                     GOTO SUBRUT
990407   
0004.00      C           CALL1     TAG
990407   
0005.00      C                     MOVEL'CALL2'   LOC
990407   
0006.00      C                     GOTO SUBRUT
990407   
0007.00      C           CALL2     TAG
990407   
0008.00      C                     GOTO EGRESS
990407   
0009.00      C*** BEGIN SIMULATED SUBROUTINE
***************************************         990408   
0010.00      C           SUBRUT    TAG
990407   
0011.00      C           LOC       DSPLY
990407   
0012.00      C                     SELEC
990407   
0013.00      C           LOC       WHEQ 'CALL1'
990407   
0014.00      C                     GOTO CALL1
990407   
0015.00      C           LOC       WHEQ 'CALL2'
990407   
0016.00      C                     GOTO CALL2
990407   
0017.00      C                     ENDSL
990407   
0018.00      C*** END SIMULATED SUBROUTINE
*****************************************         990408   
0019.00      C           EGRESS    TAG
990407   
0020.00      C                     SETON                     LR
990407   
        ****************** End of data
***************************************************************

###########################################
The above is my personal opinion and is not intended to represent good
programming practice or the product of a sound mind.

Joel Fritz 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  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.