History lists question

39 views
Skip to first unread message

Carlo Hogeveen

unread,
Feb 18, 2026, 8:41:46 AMFeb 18
to sem...@googlegroups.com

Sammy,

The context is, that I attempt to write an extension that will fix, that for concurrently opened TSE sessions only the history lists of the last closed session are remembered for future TSE sessions.

My first attempt was doing this using the macro language's history commands, but they are too slow:
I am currently running a test where all history lists are empty, and filling them to the max (65535 entries) with AddHistoryStr() is going to take in the order of half an hour.

I therefore contemplate hacking the history buffer directly.

My question is, will this corrupt TSE's functionality?
In other words, does TSE maintain meta data for its history buffer?
For example,
- does TSE also maintain an index to the history lists,
- or does NumHistoryItems() circumvent recounting list entries in the historybuffer?

Carlo



Knud van Eeden

unread,
Feb 18, 2026, 10:29:23 AMFeb 18
to sem...@googlegroups.com
image.png

FYIO:

Filling all 127 history entries with 65535 entries takes about 1 minute here in TSE for Microsoft Windows version 4.50.19

Thus not 30 minutes.

PROC Main()
 STRING s[255] = "Test"
 INTEGER I = 0
 INTEGER minI = 1
 INTEGER maxI = 127
 STRING s1[255] = ""
 STRING s2[255] = ""
 s1 = GetTimeStr()
 Message( s1 )
 FOR I = minI TO maxI
  DO 65535 TIMES
   AddHistoryStr( s, I )
  ENDDO
 Message( I )
 IF WaitForKeyPressed( 0 ) ENDIF // Activate if using a loop
 ENDFOR
 s2 = GetTimeStr()
 Warn( "Time used", ":", " ", "from", ":", " ", s1, " ", "to", " ", s2 )
END

with friendly greetings
Knud van Eedne


--

---
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 visit https://groups.google.com/d/msgid/semware/004301dca0dc%24554cfb70%24ffe6f250%24%40ecarlo.nl.

Knud van Eeden

unread,
Feb 18, 2026, 10:40:00 AMFeb 18
to sem...@googlegroups.com
FYIO:

Further if this question would have been asked in professional environments then there the feedback would have been that
hacking into the inner workings of a product by users has usually side effects.

Typically that it is not supported by the support and development, as it circumvents the usual certified and official external entries to the inner working of the product.

Typical side effects are that it might be working in a current version of the product, but not anymore in a future version
because those used by the user specific internal workings of the product might have been changed by the developer.
So it is the responsibility of the user to re-adapt it again at his end, with no support.

It might be working but no guarantee at all thus by the vendor.

But here as the action here should probably be only READING the history (=one of the buffers in memory, that is the 'history buffer') (and not writing to it assumed) it should
be save to fit it to one's purposes is assumed.

with friendly greetings
Knud van Eeden
IT specialist




Further 

Carlo Hogeveen

unread,
Feb 18, 2026, 10:44:43 AMFeb 18
to sem...@googlegroups.com

Sorry Sammy,

I hate when I do this.
After using my own brain I found the answer to my question: No.
Hopefully I wasted none of your time.

Carlo



Fred H Olson

unread,
Feb 18, 2026, 2:08:08 PMFeb 18
to sem...@googlegroups.com
I find the history feature often handy. I have pondered the problem of
when I have two TSE instances of losing the history from the first
one closed.

I usually have a "main" TSE instance and sometimes a "secondary" less
used instance in another terminal tab. The secondary instance may
just be to look up help so I can leave it open while using the help with
the primary instance. Usually the second instance is less used and
results in less history. I try to remember to close the primary
instance last but often fail to remember.

A way to force closing the primary instance last would be a big step to
reducing the problem.

Fred
--
Fred H. Olson Minneapolis,MN 55411 USA (near north Mpls)
Email: fholson at cohousing.org 612-588-9532
My Link Pg: http://fholson.cohousing.org ybb_

Knud van Eeden

unread,
Feb 18, 2026, 6:11:42 PMFeb 18
to sem...@googlegroups.com
That request seems to ask just for algorithms writing all the Histories from all TSE sessions running to e.g. totally 127 file(s) 
and then merging and cleaning (=keep unique one) and then reloading those files again at startup.

with friendly greetings
Knud van Eeden

Here example of getting the history:

image.png





--

---
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.

zhong zhao

unread,
Feb 23, 2026, 8:31:48 PMFeb 23
to SemWare TSE Pro text editor
Ref:
attached HistryIO.s

HistryIO.s

knud van eeden

unread,
Feb 24, 2026, 7:30:42 AMFeb 24
to SemWare TSE Pro text editor
Thanks for that.

1. When running it it gave an error about 'c:\TSEPro\history.ini' not found.

Simply because there is no such directory on my computer.

2. I would therefore like to suggest to not use the absolute file path like 'c:\TSEPro\history.ini'
but instead the relative filepath, that is only 'history.ini'.

3. So before:

File: HistryIO.s 4 occurrences found on 4 lines
     5:     j=MsgBox("","Do you want to export/add all input history to/from c:\TSEPro\history.ini? (Select YES to export/NO to add/cancel)",_YES_NO_CANCEL_)
     7:         EditFile("c:\TSEPro\history.ini")
    77:         if not FileExists("c:\TSEPro\history.ini") PurgeMacro(CurrMacroFilename()) return() endif
    79:         EditFile("c:\TSEPro\history.ini")


4. Thus after:

File: HistryIO.s 4 occurrences found on 4 lines
     5:     j=MsgBox("","Do you want to export/add all input history to/from history.ini? (Select YES to export/NO to add/cancel)",_YES_NO_CANCEL_)
     7:         EditFile("history.ini")
    77:         if not FileExists("history.ini") PurgeMacro(CurrMacroFilename()) return() endif
    79:         EditFile("history.ini")

5. That works OK out of the box. 
   
It looks thus for 'history.ini' in your current (working) directory.

with friendly greetings
Knud van Eeden

HistryIO.s

Carlo Hogeveen

unread,
Mar 1, 2026, 8:59:05 AM (11 days ago) Mar 1
to sem...@googlegroups.com

Time for the monthly Knud batch, only 88 messages in February.

When I stated that the AddHistory() command is slow, because it took my macro about half an hour to fully fill the history buffer (65535 values), you replied with a macro of your own that does it in about a minute.

In a test environment I threw away tsehist.dat, ran your macro, and then examined TSE buffer 6, where the history lists are maintained.
Your macro had added only 127 instead of 65535 values to TSE's history lists, hence the ~ 1 minute duration.

Aside, I recommend this tool for examining buffer 6:
https://ecarlo.nl/tse/ToolsAndExtensions.html#Hidden
Unlike Semware's tool it lets you browse a copy of the buffer, making it impossible to accidentally modify the real history buffer.

Carlo
On Wed, Feb 18, 2026 at 2:41 PM Carlo Hogeveen <mailto:t...@ecarlo.nl> wrote:

Sammy,

The context is, that I attempt to write an extension that will fix, that for concurrently opened TSE sessions only the history lists of the last closed session are remembered for future TSE sessions.

My first attempt was doing this using the macro language's history commands, but they are too slow:
I am currently running a test where all history lists are empty, and filling them to the max (65535 entries) with AddHistoryStr() is going to take in the order of half an hour.

I therefore contemplate hacking the history buffer directly.

My question is, will this corrupt TSE's functionality?
In other words, does TSE maintain meta data for its history buffer?
For example,
- does TSE also maintain an index to the history lists,
- or does NumHistoryItems() circumvent recounting list entries in the historybuffer?

Carlo



--

---
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 mailto:semware%2Bunsu...@googlegroups.com.
--

---
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 mailto:semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/CANo7bXSZfuvdw2GB4LNJNh_6F9sHu%2BH_rRSAqcdrs-f%3D65S-4A%40mail.gmail.com?utm_medium=email&utm_source=footer.

Knud van Eeden

unread,
Mar 1, 2026, 1:05:40 PM (11 days ago) Mar 1
to sem...@googlegroups.com
> Your macro had added only 127 instead of 65535 values to TSE's history lists, hence the ~ 1 minute duration.

This is the algorithm in my program

 FOR I = minI TO maxI
  DO 65535 TIMES
   AddHistoryStr( s, I )
  ENDDO
 ENDFOR

So that is expected to do the expected. So without further research by me why no 65535 values in the 127 lists, not sure.

with friendly greetings
Knud van Eeden
Artificial Intelligence
IT specialist



To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/007d01dca983%24904197e0%24b0c4c7a0%24%40ecarlo.nl.
Message has been deleted

Carlo Hogeveen

unread,
Mar 3, 2026, 2:07:27 AM (10 days ago) Mar 3
to sem...@googlegroups.com

Sorry again Sammy,

Two hours after that two weeks old message, I apologized to you for wasting your time in a follow-up message, because I could and did answer those questions myself by using my own brain.

Carlo



-----Original Message-----
From: sem...@googlegroups.com <sem...@googlegroups.com> On Behalf Of S.E. Mitchell
Sent: Tuesday, March 3, 2026 2:26 AM
To: sem...@googlegroups.com
Subject: Re: [TSE] History lists question

> - does TSE also maintain an index to the history lists,

No.

> - or does NumHistoryItems() circumvent recounting list entries in the historybuffer?

I don't understand this question, sorry.
--
> --
>
> ---
> 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 visit https://groups.google.com/d/msgid/semware/004301dca0dc%24554cfb70%24ffe6f250%24%40ecarlo.nl.

--

---
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 visit https://groups.google.com/d/msgid/semware/CA%2BgEvkZ%2BOSyqUsRw2C3M91P2YvKwNKMBbB_-kS3-q0ofS-5RVw%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages