Return to Mainframe Utilities Page
Module
ISREDIT MACRO NOPROCESS (OPT1) ISPEXEC CONTROL ERRORS RETURN /**** SET MESSAGE DISPLAY ON/OFF BASED ON THE DEBUG SWITCH ***/ ISPEXEC VGET (DBGSWTCH) PROFILE IF &DBGSWTCH = &STR(ON) THEN CONTROL MSG LIST CONLIST SYMLIST NOFLUSH ELSE CONTROL NOMSG NOLIST NOFLUSH NOPROMPT IF &OPT1 = HELP THEN GOTO HELPSEC /********************************************************************** /* UTILITY: FLOW * /* AUTHOR: DAVID LEIGH * /* FUCTION: INDENT AND "TFLOW" A PARAGRAPH TO THE POINT WHERE THE * /* CURSOR IS. * /********************************************************************** /********************************************************************** /* PARSE THE CURRENT SITUATION AND DO THE INITIAL FLOW. * /********************************************************************** ISREDIT (SLINE,SCOL) = CURSOR ISREDIT FIND FIRST P'¬' .ZCSR .ZCSR ISREDIT (LN,CL) = CURSOR ISREDIT LABEL .ZCSR = .CURR IF &DATATYPE(&OPT1) = NUM THEN + SET LRECL = &OPT1 ELSE + IF &STR(&OPT1) = DISPLAY THEN + ISREDIT (NULL,LRECL) = DISPLAY_COLS ELSE + ISREDIT (LRECL) = LRECL ISREDIT TFLOW .ZCSR &EVAL(&LRECL - &SCOL + 1) ISREDIT (X,Y) = FLOW_COUNTS /********************************************************************** /* LOOP THROUGH AND DO THE SHIFTS. * /********************************************************************** IF &EVAL(&SCOL - &CL) > 0 THEN + DO &I = 0 TO &EVAL(&Y - 1) ISREDIT CURSOR = &EVAL(&SLINE + &I) 1 ISREDIT SHIFT ) .ZCSR &EVAL(&SCOL - &CL) END /********************************************************************** /* RETURN TO THE ORIGINAL CURSOR POSITION * /********************************************************************** ISREDIT CURSOR = &SLINE &SCOL ISREDIT TFLOW .ZCSR &LRECL EXIT HELPSEC: + 02480000 ISPEXEC SELECT PGM(ISPTUTOR) PARM(HELPSHEL) 02490000 SET ZEDLMSG = &STR(*** HELP DISPLAYED FOR FLOW UTILITY + 02490000 *** NO PROCESSING PERFORMED ***) 02490000 ISPEXEC SETMSG MSG(UTLZ000) 02490000 EXIT
Documentation
The FLOW edit macro allows you to place your cursor on a particular column on a piece of text and it will "text-flow" from the line where your cursor is and then indent the results to column where your cursor is. It assumes that the right most boundry of the the text will be the LRECL of the file being edited. As an example, this paragraph begins in column 2 and goes to column 80 if you are browsing it. If you are printing it with carriage control, it will be 1 an 79 respectively. Anyway, if I type flow on the command line and then place my cursor on the word "this" (on the "t" of "this") and press, the paragraph is processed and looks like the following: As an example, this paragraph begins in column 2 and goes to column 80 if you are browsing it. If you are printing it with carriage control, it will be 1 an 79 respectively. Anyway, if I type flow on the command line and then place my cursor on the word "this" (on the "t" of "this") and press , the paragraph is processed and looks like the following: As an alternative to typing "FLOW" on the command line each time, you could set a PF key to "FLOW" instead. This could be quite helpful if you are currently editing a doucument file and you will be doing this often. If FLOW is on a PF key, you would just place your cursor where you want the flow to start and the indentation to start, and press the assigened PF key.