× 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: DOW vs DOU
  • From: rbbaird@xxxxxxxxxxx (Rick Baird)
  • Date: Thu, 29 May 1997 20:58:35 +0100
  • Organization: Premium Systems, Inc.

Kahn, David wrote:
> 
> On May 24 1997 John P. Carr wrote:

> >     KEY  READEF1234                 90
> >     *IN90     IFEQ *ON
> >                    LEAVE
> >                    ENDIF

Since were on the subject, I would like some opinions on a coding
technique that I've been using for several years now.  I use the LEAVE 
and ITER opcodes extensively as a sortof GOTO replacement (ooh, maybe
that isn't such a good thing to compare it to.....

I like it (obviously) and I think it makes things a lot kinder on the
eyes.

Here are a couple of examples: (doesn't line up, spaces added between
opcode and factor 2 to make it more readable)

for screen processing subroutines:

C       F1DISP     BEGSR

C                  EXSR  F1INZ             (any pre-screen processing)

C       1          DOWEQ 1                 (obvious never-ending loop,
C                  EXFMT FMT1               requires LEAVE to exit)

C       *INKC      IFEQ  *ON               (leave loop if F3 or F12 is
C       *INKL      OREQ  *ON                pressed)
C                  LEAVE                    
C                  END

C       *INKD      IFEQ  *ON
C                  EXSR  F1PRMT            (prompt/lookup inquiry calls)
C                  ITER                    (return to screen)
C                  END

C                  EXSR  F1EDIT            (input field editing)
C       $ERROR     IFEQ  *ON
C                  ITER
C                  END

C                  EXSR  F1UPDT            (file update)
C                  EXSR  F1INZ
C                  ITER
C                  ENDDO

C                  ENDSR

and the edit routine:

C       F1EDIT     BEGSR

C                  MOVE  *OFF      $ERROR

C                  DO

C       KEY1       CHAIN FILE1              90
C       *IN90      IFEQ  *ON
C..... insert your error messaging code of choice
C                  MOVE  *ON       $ERROR
C                  LEAVE
C                  END

C       KEY2       CHAIN FILE2              90
C       *IN90      IFEQ  *ON
C..... insert your error messaging code of choice
C                  MOVE  *ON       $ERROR
C                  LEAVE
C                  END

etc....

C                  ENDDO

C                  ENDSR

These techniques cut down on the nesting levels, and the code is very
re-usable.

Comments?  Does anyone else use the leave and iter opcodes as much?

Is this readable to someone not used to seeing things done this way?

Thanks, 

Rick
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the Midrange System Mailing List!  To submit a new message,   *
* send your mail to "MIDRANGE-L@midrange.com".  To unsubscribe from     *
* this list send email to MAJORDOMO@midrange.com and specify            *
* 'unsubscribe MIDRANGE-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 ...

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.