|
Post by stephenf on Oct 8, 2022 10:49:03 GMT -5
One feature of the ISPF editor that I frequently use is the K append on the A line command. It makes it much easier to copy/move a line or lines and place them in multiple parts of the data.
Here's the ISPF editor help on the feature that might explain it better:
The A (after) line command identifies the destination when data is to be moved or copied after a line in the data.
A K can be appended to the A to indicate that the source is to be used with multiple destinations. The last destination must not contain the K append so that ISPF knows the command set is complete. No part of the command set is executed until the command set is complete. The K append is only valid for line copy and move commands.
000300 a 0400 Data will be moved or copied after this line. 000500
000300 ak 400 Data will be moved or copied after this line. 000500 a 0600 The same data will be moved or copied after this line.
I noticed that SPFLite already supports the number append, ie A4 results in four copies of the copied/moved lines being placed at the location. Although the ISPF editor help it doesn't specifically mention it and I don't think I've ever used it in earnest, the ISPF editor actually supports using both at the same time.
000300 ak3 00 Three copies of the data will be moved or copied after this line. 000500 a4 600 Four copies of the same data will be moved or copied after this line.
Thanks for a great piece of software and I hope you find my suggestion useful. Stephen
|
|
|
Post by stephenf on Oct 8, 2022 15:15:46 GMT -5
Thanks for the quick response.
I hadn't come across the Retain line-command modifier and it is indeed very slick. I really like that you can use it on a target location in the data (i.e. A&) and then copy/move data from multiple locations to the same place without having to come back and place the A again after each one. That is definitely a feature that I would use a lot if it were available in the ISPF editor and I will definitely use it in SPFLite.
C&/CC&/ does indeed provide the sort of functionality I was looking for, but I still feel the K modifier could be useful. I don't think it would conflict with the & modifier functionality, they do similar things, but in such a different way that I don't think they would conflict one another. SPFLite wisely chose not to use K for this feature as, like mentioned in the help, it doesn't really work the same. Of course AK& wouldn't make sense, much like M&/MM& doesn't.
One feature I actually like about the K modifier in ISPF is that nothing happens until you complete the set. I can scroll through my data entering AK on as many lines as I like and nothing gets copied until I am ready. I don't have hit enter and complete a copy before I place the next AK. I can easily see all the target locations I've setup and change them around before completing the set and doing a copy. I can choose to cancel the entire thing anytime before completing the set with a reset and I can also undo the entire thing with a single undo. Also the source data can be from a move rather than a copy, which is not something you can do with & for obvious reasons.
Anyway, thanks for listening and I hope I explained myself clearly. Like I said, the & functionality is very nice and I feel K would complement it, not conflict with it.
I've also realized I need to have a better look through the help as I can see there are many very spiffy features I'm not aware of that look very useful.
One last thing, I was playing around with the & modifier and setup up both a C& and an A&. Of course they are both retained and therefore the copy occurs every time I hit Enter or PF7/8. It's just doing what I asked it to do of course, but maybe it would make sense to only allow one line command to be retained at any time?
Thanks, Stephen
|
|
|
Post by Stefan on Oct 9, 2022 10:03:01 GMT -5
Hello Stephen and Welcome.
I have thrown together a wee CK.MACRO and a similar MK.MACRO (essentially the same code, but needed so you get a Copy and a Move command). Use them as line commands, ie. CK/CKK to identify one or more consequetive line(s) to be copied.
Similarly, use MK/MKK to select lines to be moved.
Do Not use line commands A, B, or H to show where the data is to be placed, use :A, :B or :H intead.
This way you can tag multiple target locations for the data. As it stands, it doesn't permit you to mix the target tags in one execution, but that would be a relatively simple change.
You'll need to place the two macros into your <wherever>\ SPFLITE\MACROS folder
As I said - thrown together - so I've done minimal testing.
For instance, I've not tested source ranges with excluded lines, etc but you can play around with it if you wish.
UPDATE: Macros have been moved from here to their own thread. Find them in this forum under MACRO DISCUSSION - CONTRIBUTED MACROS Thread entitled "COPY/MOVE one or more lines to multiple target locations"
As you can see, it is really amazing what you can do in SPFLite, so the manuals are well worth a closer look.
|
|
|
Post by Stefan on Oct 13, 2022 13:05:14 GMT -5
stephenf,
OK, Update time....
The previous CK and MK macros were a bit rough and ready, so here's Version 2.
What's the difference in V2?
- My understanding of the 'HERE' line command was wrong. H/HH is supposed to replace the marked lines. Fixed in V2 - Includes line tag validation to ensure 'block' tags are properly paired, etc - Supports use of : and :OR tags to overlay lines, with or without replacing non-blank data. - Supports use of a single line tag (eg. : ) that actually refers to an Excluded line block - Allows different target locations to be mixed. So you can Copy or Move lines BEFORE line x AND AFTER line y AND Overlaying the block between lines p and q, etc. all in one execution.
- Allows invocation from the command line, e.g. CK or MK, in combination with the normal C/CC line commands to select the 'source' lines as well as invocation via CK/CKK or MK/MKK line commands to select the 'source lines'.
Note that both methods of invocation require the use of line tags (:A, :B, etc) to denote the target areas.
I'll post these in Contributed Macros as well. Happy to receive bug reports.
As before, CK COPIES lines, whilst MK MOVES lines.
UPDATE: Macros have been moved from here to their own thread. Find them in this forum under
MACRO DISCUSSION - CONTRIBUTED MACROS Thread entitled "COPY/MOVE one or more lines to multiple target locations"
|
|
|
Post by George on Oct 13, 2022 14:27:41 GMT -5
Stefan: Impressive, you have certainly become the resident macro Guru. I'm happy to see the macro language can actually accommodate what's needed to make it work.
Kudos!
George
|
|
|
Post by stephenf on Oct 14, 2022 10:07:25 GMT -5
Thanks Stefan!! I will check them out shortly. I really appreciate the work.
|
|
|
Post by Stefan on Oct 14, 2022 12:15:11 GMT -5
Stefan: Impressive, you have certainly become the resident macro Guru. I'm happy to see the macro language can actually accommodate what's needed to make it work. Kudos! George Thank you George, but I'm really just a coding monkey. You have built an incredibly versatile platform and provided a fully-featured macro inerface.
The credit lies as much, if not more, with you and Robert than it does with me.
Glad to be of service.
|
|
|
Post by Stefan on Oct 15, 2022 9:52:30 GMT -5
R,
Not being funny, but does use of the native B& line command not do exactly what the MB.MACRO does?
|
|