Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 29, 2019 10:08:13 GMT -5
Robert, yep fat fingers. George, thanks for the MACRO tips. Both: I loved the story (play..Act 1, Act 2, etc), about F and FF. Sounds like something that would happen to me. Question - Which takes precedence, a PRIMARY COMMAND or a MACRO with the same name? BTW, I am really impressed with all the work that has gone into this product. And the helpfulness of you both. PS I googled BASIC, I had no idea of its history. Now I do.
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 29, 2019 10:40:22 GMT -5
Oh yeah, I absolutely love the clipboard functionality. Nice job.
|
|
|
Post by George on May 29, 2019 12:19:32 GMT -5
Ren: Robert: I'm not keen on letting a macro name duplicate and override a primary command. SPFLite internally does many calls to the primary command processors for various reasons. I don't need the worry that some macro will intercept and 'do it's own thing" when I expect and need the internal code. And really, is making up a name that hard? Just stick a period or something on the front, so you'd have .SAVE instead of SAVE, or whatever.
George
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 29, 2019 14:26:37 GMT -5
George, In a previous post I mentioned various find MACROs I have written in the past. FN, FL, FP, and FF. (Find Next, Find Last, Find Previous, and Find First, respectively). All take their input from the string pointed to by the cursor. Unfortunately SPFLite already uses FF (for something I will probably never do). I was hoping I could still write a MACRO named FF which would be honored first. But I know "F" command was issued. It was all recursive, so you could issue FN on one string then FN on another string, and then BACK;BACK to return to the origination point. Eventually I will replicate these functions in SPFLite. I just don't know what to name FF. .... Maybe FT - Find starting from the Top) :-)
Next question: Can I make my mouse hit <enter> when I double left click. I did figure out how to map the right mouse key to <enter>, which will work, it's just something else for my fingers to learn.
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 29, 2019 14:43:50 GMT -5
Robert is correct. In my corporate mainframe days, I had, (ISPF WIDE), SAVE and END MACROs, that overrode the builtin SAVE/END commands. These did various special processing depending on the dataset or type of dataset being process. At one company when a dataset (think source program) was saved, a copy was FTPed to a server somewhere (why? I don't know, I just worked there). At another, who had very ridgid documentation standards, the SAVE would review the date/time stamp on the (mandatory) comments block and compare current date and time to insure whoever changed the program updated the comment block, if not it would not let you save.
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 29, 2019 15:09:49 GMT -5
Next question: why does this not work? I get:
Error:Description: Assignment type not supported. Something is wrong with variable assignment. Line number: 23 Line code: SPF_OVR_REP(37, 1, TEMP) Token found: End of line
000008 dim temp as string 000009 dim top, bot, i, amts as number ------ ----------------------------------- 000022 temp = "top =" top 000023 SPF_OVR_REP(37, 1, temp) 000024 temp = "bot =" bot 000025 SPF_OVR_REP(38, 1, temp)
note: top = Get_Src1_Lptr
it does however, before it dies, inserts "top =" on line 34 (even though I told it to overlay line 37)
Oh yeah, it would be nice if you could cut the line numbers along with the data line (when writing to the Windows clipboard). In my above example I had to manually insert the line numbers. :-)
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 29, 2019 18:30:04 GMT -5
Robert. thanks. That works. I guess because of the DIM statement says string it knows to concatenate but if it was numeric it would ADD? Why are my line numbers not working right? I tell it line 58: SPF_OVR_REP(58, 1, "stuff") but it puts it on line 56?
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 30, 2019 9:25:56 GMT -5
Ok, I read it. Makes sense. Were having some fun now...
I found a typo in: SPFLite Edit Macros - V10.2.19129 - 2019-05-10, under Rexx Functions
pos(needle,haystack) - instr(,needle,haystack) pos(needle,haystack,start) - instr(start,needle,haystack)
but under: String Handling, under INSTR It shows the correct way
PS is there an .AUTO file for MACROS? x = INSTR("xyz", "y") ' returns 2 which would be INSTR(haystack,needle)
And another typo, in SPFLite Edit Macros - V10.2.19129 - 2019-05-10
TRIM Result-str = TRIM$(str-expression [, [ ANY ] Chars-To-Trim)
I think the TRIM should be TRIM$
Thanks Ren
|
|
|
Post by George on May 30, 2019 12:14:18 GMT -5
I corrected the needle,haystack errors (there were several).
Ren: Having fun are we?
I will look at letting macros override internal, it may not be as bad as I thought. No promises.
George
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 30, 2019 12:23:33 GMT -5
Good to know about colorization vrs performance, thanks.
Here's a quirk:
undo;top works,
but
undo;l 1 does not (the undo works but the locate does not, no matter which line you "l").
Actually it is kind of annoying that UNDO repositions the display. I wish it would just undo the changes and leave the display alone. That way even though I'm at the top when entering UNDO, I would not have to issue the TOP command after the UNDO completes. (But I can use UNDO;TOP).
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 30, 2019 12:24:55 GMT -5
George, thanks for looking.
|
|
|
Post by George on May 30, 2019 12:56:55 GMT -5
Ren: UNDO is not the greatest. It does not do it via rollback as most editors do, it is a complete checkpoint of the data being reloaded. So stacking commands really don't work (as you found out) since the entire editor data-space is recreated. It would be nice to have done it differently, but SPFLite's internal storage methods just aren't amenable to doing so.
Further on Macro over-ride of commands. This looks do-able, I'll test some changes out and let you know.
George
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 30, 2019 13:35:17 GMT -5
George, I understand what you are saying about the UNDO just reloading a saved copy, but could it not "remember" what line was at the top of the display when the UNDO is issued, and after the reload, just do a locate to reposition it to the "remembered" top.
Good news about the MACRO override. Thanks again for looking. Yes ... fun... (learning a new language is fun, if you consider absolute frustration, followed by the joy when it finally works, fun). With my MACRO development, I'm still at part 1 (not joy). But I'll get there.
|
|
|
Post by George on May 30, 2019 16:05:46 GMT -5
Ren: Your avatar is better every time I see it. Good job.
George
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 30, 2019 17:34:38 GMT -5
Thanks man. I could not figure out how to make my beard white, but I took Roberts que and say that's what it looked like 30 years ago. ;-)
So I was just reading about multi-edit. Very cool, I might have to change a common var name in a little 10 module REXX system I have for my own finances just to try it out.
And the LINE command, issued from the Command line to issue line commands. How cool is that? I can see some good use for that (once I ever get my MACRO working). Presumably, I can build a Command Line Macro, say: COM, which will read the C/CC-CC and comment out that line or chunk of lines. I'm thinking since I have a Line Command Macro by the same name, when it figures out that it not a line command (by virtue of Is_primary_Cmd/Is_Line_Cmd), it can issue LINE COM lprt1 lptr2. I hope LINE tells the macro that it is a line command this time around (that is I hope Is_Line_Cmd gets set).
|
|