The sword of Damocles! ----DupAllLineInCV.s

13 views
Skip to first unread message

zhong zhao

unread,
Aug 10, 2022, 6:05:25 AM8/10/22
to SemWare TSE Pro text editor
First,
in TSEPro\ui\tse.ui, insert code in attached DupAllLineInCV.s

Second,
when you in CompressView (After <alt v>,search string,<Enter>),
you can press <Alt e> edit this list, 
of course, when you modify something in this list, except the file:... line and the line number : before each line,

Third,
you can press <alt shift e> to duplicate all changes in this list to their corresponding file!

Warning! 
This function is the sword of Damocles!!
It's best to make proper backup before using it!!!
DupAllLineInCV.s

knud van eeden

unread,
Aug 10, 2022, 9:21:28 AM8/10/22
to SemWare TSE Pro text editor
1. This original version did not compile (e.g. declarations missing and putting a function after the main, so that it can not be found (solution=use FORWARD on top of the program (similar to Pascal / Delphi).

2. See attached version, please double check again if everything works as intended, then please attach your improved version again.

3. Please clarify further what could go wrong (=the sword) in your experience so that that can be anticipated.


-
DupAllLineInCV.s

knud van eeden

unread,
Aug 10, 2022, 9:31:42 AM8/10/22
to SemWare TSE Pro text editor
> Third,
> you can press <alt shift e> to duplicate all changes in this list to their corresponding file!

Actually there is an existing TSE solution for that.

cv2org.zip (by Richard Lassan, created in 1995).

Download it here: 




That is a very stable and very handy TSE program which I used and use successfully for many years and almost every day to do changes after a search, then compressed view and put these back, a highly recommended solution).

So if you are referring to this (overwriting) replacement in the original file as the 'sword', then it is probably better to use that stable existing other TSE program.

What one should always do is only use the latest search and then not changing anything yourself in the original program, that is of course a must.

Maybe your solution can then be merged with this program to an even better one, though that cv2org.s works thus as a charm and is one of my most important TSE macros.



knud van eeden

unread,
Aug 10, 2022, 9:37:11 AM8/10/22
to SemWare TSE Pro text editor
And in my experience cv2org.s has never failed after using it 10000 times and more. It replaces everything as it should (also very long lines greater than 255 characters).


The only other requirement is not to fiddle with the filename in the top first line and not adding empty lines.
// NOTE:      For this to work properly the beginning line   *
//            number and colon must NOT be removed from      *
//            compressed view.                               *


--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/semware/293263566.3290339.1660138299021%40mail.yahoo.com.

zhong zhao

unread,
Aug 10, 2022, 11:27:34 PM8/10/22
to SemWare TSE Pro text editor
I don't mean that macro execution may make mistakes; Instead, the function of this macro will copy the modified text in the compressed display back to the old line number corresponding to many source files regardless. Once the file of the source file on the disk is edited and modified by other programs during this period, causing the line number to change and is read by TSE, you will get confused results. Therefore, it is best to back up the files involved before using this function.
Reply all
Reply to author
Forward
0 new messages