Post by Stefan on Feb 24, 2022 6:50:02 GMT -5
The LP.MACRO (List Proc) locates the header line of named or all
- Procedures, Methods and Routines for REXX
- Subroutines and Functions, Methods and Properties for BASIC
- Table headers for CFGMAINT-generated .TXT files.
- Procedures, Methods and Routines for REXX
- Subroutines and Functions, Methods and Properties for BASIC
- Table headers for CFGMAINT-generated .TXT files.
LP can be executed even if line commands C/CC, M/MM, A,B are pending. Such line commands are saved and restored after LP completes.
PF5 (RFIND) will work as usual following LP with a specified <proc> name.
PF5 (RFIND) will work as usual following LP with a specified <proc> name.
The code is heavily commented so should be easily modifiable.
It uses Regular Expressions in searches for procedure names.
Useful Reg-Ex information can be found at
LP.MACRO (75.8 KB) (Version 18, uploaded 28th February 2023)
Changes from v17:
- *Fix* LP did not recognise a BASIC procedure name if it was immediately followed by the ':' (colon) statement separator or <End-of-Line>). Similarly for REXX and the ';' statement separator
Changes from v5:
- *Chg* The file's "type" is now auto-detected using the profile name assigned by EFT. The command arguments #BASIC, #REXX, #TEXT, #NONE and associated SET variables are no longer needed.
- *New* Another syntax case has been added to allow you to jump into a procedure which includes a specific line number
- *Fix* The X, NX, etc arguments now work correctly when used with the ALL keyword
- *Chg* To select the word under the cursor, use a single '_' (underscore), replacing '/' and '\' command arguments which have ben removed.
- *New* The command argument 'S' (Show) has been added as a synonym for 'NX' (do not Exclude).
- *New* The command argument 'DX' (Do not change exclude line status) has been added.
Environmental Recommendations:
- SET entry: SET PENDING.LP = Y to accommodate 'pending' line commands
- SET entry: SET TRACK.LP = Y to accomodate the '(Track)' feature
- EFT entry: CFGMaint EXP*.TXT = TXT_CFG to accommodate CFGMAINT EXPort files
- SET entry: SET PENDING.LP = Y to accommodate 'pending' line commands
- SET entry: SET TRACK.LP = Y to accomodate the '(Track)' feature
- EFT entry: CFGMaint EXP*.TXT = TXT_CFG to accommodate CFGMAINT EXPort files
Syntax Case 1: Locate a specific procedure using the line tag created by LP itself.
(I implemented this because line tags begin with a colon ':' which is more awkward to type than a dash '-')
LP -<tag> | :<tag>
[ X | NX or S | DX ]
:<tag>
Syntax Case 2: Locate the procedure which includes a specific line number.
(Useful when the system tells you the line number in error)
LP <l-num>
[ X | NX or S | DX ]
(Useful when the system tells you the line number in error)
LP <l-num>
[ X | NX or S | DX ]
<l-num> Displays the procdure which contains the requested line number.
Syntax Case 3: The main functions of LP. Find a named or all procedures/routines/methods, etc.
LP [ <proc> | _ ]
[ NEXT | PREV | FIRST | LAST | ALL ]
[ NEXT | PREV | FIRST | LAST | ALL ]
[ PREFIX | SUFFIX | CHARS | WORD ]
[ X | NX or S | DX ]
[ TAG or T | NOTAG or NT ]
<proc> If specified, it is a partial or whole name of a procedure, etc. to search for.
[ TAG or T | NOTAG or NT ]
<proc> If specified, it is a partial or whole name of a procedure, etc. to search for.
If not specified, LP will exclude all lines, except for the headers of all procedures in the file.
If _ is specified, LP will use the word under the current cursor position as the name to search for.
This is especially useful when LP _ is mapped to a Fn-Key or mouse button.
For example:
To jump from any procedure call to the definition of that procedure in one click, map the right mouse button to:
!LP _ NX
ALL IF specified, LP will find all procedures whose name includes the <proc> value, or all procedures, if <proc> is not specified.
LP without any operands is equivalent to LP ALL
NEXT These have the usual meaning, except that there is an automatic 'wrap-around' search.
PREV So if LP xxx NEXT doesn't find another match, it will wrap and retry the search from the top of the file.
FIRST When one of these terms is the only operand, LP will locate the next, previous, first or last procedure of any kind.
LAST Use LP NEXT or LP PREV without a name to jump from one procedure header to another.
It is useful to to map these commands to keys, e.g.
CTRL-Up-Arrow: !LP PREV(Left 1) e.g. "Which procedure am I in?"
CTRL-Down-Arrow: !LP NEXT(Right 1) e.g. "Where's the end of this procedure?"
PREFIX These have the usual meanings, but note that the DEFAULT is PREFIX.
SUFFIX PREFIX and SUFFIX may be abbreviated to PRE and SUF respectively.
CHARS Use CHARS if the <proc> string may be preceded and/or followed by other parts of the procedure name.
WORD Use WORD to find an EXACT match.
X Is implied if the ALL keyword is also specified. It excludes all procedure bodies from the display.
If specified when searching for named procedure, the body of the procedure is excluded from the display.
NX or S Is implied when searching for a named procedure, so the body of the procedure is visible.
If specified with the ALL keyword, the procedure bodies are not excluded from the display.
NT By default, all procedure header lines found are tagged with an acronym of the function's actual name.
If specified, such tagging will not occur.