Last active
December 15, 2022 13:51
-
-
Save lbdyck/3659966f346a76acb21359ba1105dac3 to your computer and use it in GitHub Desktop.
ISPF Edit Macro to Add or Remove a label
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ------------------------- REXX ------------------------------ * | |
| LABDEL: Sample REXX code to set a label and to remove a label | | |
| based upon the provided parm. | | |
| | | |
| Syntax: labdel option | | |
| | | |
| option value: null - add the label | | |
| anything else - remove the label | | |
| | | |
* ------------------------------------------------------------- * | |
| Author: Lionel B. Dyck | | |
* ------------------------------------------------------------- */ | |
address isredit | |
'macro (opt)' | |
if opt = '' then do | |
/* Find string text */ | |
"find 'string' first" | |
if rc > 0 then exit /* no string found */ | |
'(line) = cursor' /* get line number */ | |
'label' line '= .LAAA 0' /* set label .LAAA on the line */ | |
end | |
else do | |
/* now remove the label */ | |
'reset label .LAAA .LAAA' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment