Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 31, 2019 10:37:07 GMT -5
I was only going to have one MACRO, COM. When invoked as a line command it would use COMM-COMM and/or COMn, and if it was issued from command line, use C and/or CC-CC. The Command line piece of code would issue the LINE command. Again, this would only work if Is_Line_Cmd gets set correctly. The command line piece would honor all the normal things, like exclusion status, labels, bounds, before calling LINE. I guess I need to read up on block-mode line commands. :-)
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 31, 2019 11:07:19 GMT -5
How does one close the console window created by SPF_Debug with out it closing SPFLite?
|
|
|
Post by George on May 31, 2019 11:27:39 GMT -5
The debug window cannot be closed (without closing SPFLite too), just minimize and ignore it. It IS only for debugging after all.
George
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 31, 2019 11:28:23 GMT -5
thanks George
|
|
|
Post by George on May 31, 2019 11:29:23 GMT -5
Robert: Reading back through the thread, I noticed your comment about my beard. It's been back for quite a while now, so my avatar is pretty close now. Just a bit more grey, wrinkles, etc.
George
==> I have "forgotten to shave" for about 2 weeks now. And yes, my "beard" such as it is, is all gray. That's one of the (main) problems about getting old. When I was younger, it only took 2-3 weeks for it to actually *look* like a beard, because the hair was all dark brown. Now, because there is not much contrast between light gray and my skin tone, it takes 6 months for it to really look like a beard and not like I "forgot to shave" :-))
R
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 31, 2019 13:37:46 GMT -5
You know how, in ISPF, you type some stuff on a line and realize you were on the wrong line, and without hitting <ENTER> you can hit <escape> and that will refresh the screen as though it never happened? Is something like that available in SPFLite? Or do I have to go ahead and hit <ENTER> then UNDO (and pray)?
In Dec of 84, I was shaving for the 2nd time that day, getting ready for the company Christmas party, and thought: shaving, how absurd. I've not shaved since. Trimed yes, shave no.
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 31, 2019 15:35:40 GMT -5
You are correct, I think I had ALT ESC defined as ATTN, which would reload the screen too, and you're right PA1 would do the same. George, do your thing...please.
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on May 31, 2019 17:19:59 GMT -5
So my COM MACRO is getting there, however in my testing, I noticed what I would consider, odd behaviour:
Before:
Command > =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 000008 000009 test 3 this should get /* in 1 and */ in 1 on new line below 7890 000010 com test 4 insert /* on new line before and */ on new line below 7890 000012 this is just a dummy line 000013 ****** ******************************* Bottom of Data *********************************
After:
Command > =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 000008 000009 test 3 this should get /* in 1 and */ in 1 on new line below 7890 000010 000011 /* 000012 test 4 insert /* on new line before and */ on new line below 7890 000012 */ 000013 ****** ******************************* Bottom of Data *********************************
The MACRO did what it should, but because of the two inserts, the data originally on line 12 was pushed off the bottom. Not what I expected. My line before statements: j = i - 1
SPF_CMD("LINE N !" & TSTR$(j)) SET_LINE(j+1, tt)
My line_after statements: SPF_CMD("LINE N" +i) SET_LINE(i+1, tt2) I'm in the middle of a "for i = top to bot" loop, so in both cases, i, top, and bot are incremented by +1 each. (top and bot are originally set by Get_Src1_Lptr and Get_Src2_Lptr, respectively).
So how do I keep line 12, and 13, from falling into the bit bucket?
Did I mention: "I'm having some fun now"?
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on Jun 1, 2019 6:15:23 GMT -5
com.macro (1.73 KB) Attached is the MACRO. Note I used the examples for LINE AFTER and LINE BEFORE from the "REXX" section of help. If ADD is more appropriate, perhaps it should be mentioned in that section as an alternative (and why you would use it). I thought I was doing everything using all line_pointers and not line_numbers.
|
|
|
Post by George on Jun 1, 2019 10:03:16 GMT -5
Ren: Haven't tested your macro (yet), but I see (twice) bot + bot + 1 which I'm sure should be bot = bot + 1 or simply INCR bot.
I know the PA1 problem, I too accidentally over type text thinking I'm on the command line and go &%$^&(& !!
But providing an ESC / PA1 style support is extremely difficult because so much of the KB support is immediate, the data lines are changed as you type. Trying to 'unwind' the typing between one Enter and another would be really tough.
George
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on Jun 2, 2019 8:35:26 GMT -5
Thanks to you both. Attached is my working version. Apparently my confusion stems from which commands want a line_pointer and which ones want a line_number. Responding to Roberts laundry list: 1. The way it is written, it makes no difference the RECFM. The ending comment indicator will always be in 69-70, if everything after that is spaces, otherwise it will insert a line with */ in col 1. 2. I understand what you are saying, but since I don't know how to "wrap", so it didn't. (I'm to old to appreciate rap, I guess). 3. This is something I plan on adding, but I just wanted to get the basic flow working first. 4. Good to know. 5. Nice addition. (I didn't incorporate it in this version, but will in future renditions). 6. I know, but since I'm still learning syntax, I knew the "Trim" would work and was not sure about "". 7. Overlay works, I've not yet investigated the Set_Line command. Is there any advantage of one over the other? 8. I'm not sure what a "short string" is, but since I'm looking for spaces, it the line is less then where I looking (69-70) for instance, then it should not make a difference. Right? But I will check out LSET and MID 9. Got it. 10. Went with "bot to top" Enhancements: A: check for (item 3 above) existing embedded comments B: if primary command, rather than halting with message, have it build and issue a SPF_CMD("LINE COM .... command Next: UNCOM Thanks again for your help and great product. Attachments:com.macro (1.6 KB)
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on Jun 2, 2019 8:43:24 GMT -5
George,
Since you already have a snapshot of the entire dataset from the last time <ENTER> was pressed, could you not, when ESC is pressed, record the currently displayed top and bottom positions and restore just that snapshot from the UNDO dataset, and not reload the entire dataset as UNDO would do?
|
|
|
Post by George on Jun 2, 2019 10:27:03 GMT -5
Ren: For performance reasons UNDO does everything 'in bulk' using PowerBasic I/O functions that are very efficient. i.e. entire arrays are written/read in one statement. And there are 4 coordinated arrays involved, two of which are resource pools of text strings that are basically randomly allocated to the other two fixed arrays. Trying to 'pick out' a subset of this to be restored would a) be tricky and b) have to use non-bulk type I/O and would suffer badly performance-wise.
George
|
|
Ren
Sophomore Member
Retired Mainframer
Posts: 82
|
Post by Ren on Jun 2, 2019 13:09:42 GMT -5
Attached is my latest: UNCOM .MACRO I have no idea if my logic is sound, of if my commands will work, because I can't get past the following error: Error code: 12 Error Description: NEXT Without FOR or FOR without NEXT. Lin Number: 70 Line Code: END IF Token found: IF All my IF/THEN-END IF statements match up as does the FOR and NEXT. Please review and and tell me what I missed. Thanks Attachments:uncom.macro (2.39 KB)
|
|
|
Post by George on Jun 2, 2019 15:56:37 GMT -5
Ren: You have several places where you've coded '' (single quotes) rather than "" (Double quotes) for a null string.
Remember a single quote starts a comment. George
|
|