Easy OMITs

Mark Goldberg had a nice tip in the March 16 ClarionLive webinar. Highlight some text you want to omit and click on the drop button as shown:

You'll get another window where you can type in the terminator and an optional expression:

With no expression you'll get this:

    OMIT('**END**')
    CASE STATUS(PassedLabel)           !Check parameter passed
    OF WINDOW:OK                       !if window is good, and opened
        CYCLE                          !continue
    OF WINDOW:NotOpened                !if window is good, but not opened
        OPEN(PassedLabel)              !open it
    OF WINDOW:BadWindow                !bad window?
        MESSAGE('Invalid Window','Note:') !exit procedure
        RETURN
    END
    !end of OMIT('**END**')

Type in an expression or value (you'll need to define an equate somewhere to define the value) and you get a conditional omit. With an expression of MyFlag you get this:

    OMIT('**END**', MyFlag)
    CASE STATUS(PassedLabel)           !Check parameter passed
    OF WINDOW:OK                       !if window is good, and opened
        CYCLE                          !continue
    OF WINDOW:NotOpened                !if window is good, but not opened
        OPEN(PassedLabel)              !open it
    OF WINDOW:BadWindow                !bad window?
        MESSAGE('Invalid Window','Note:') !exit procedure
        RETURN
    END
    !end of OMIT('**END**', MyFlag)