TSE: Feature: Request: Copy a string to the TSE clipboard [CopyToTseClip() <-> CopyToWinClip()]

11 views
Skip to first unread message

knud van eeden

unread,
May 22, 2024, 7:43:20 PMMay 22
to SemWare TSE Pro Text Editor, S.E. Mitchell
Hello,

Note: Already a very long time I have been wondering why this does not already exist as it is a very
handy thing to have and the demand for it occurs very frequently.

---

1. As far as I know at this moment there does not exist I assume a very much asked for command to (in a simple, short and effortless way):

 "copy a string to the TSE clipboard"

2. For the Microsoft Windows clipboard this already exists and you can write and run successfully:

PROC Main()
 STRING s[255] = "foobar"
 CopyToWinClip( s )
END

3. But there does not exist a TSE equivalent thus as far as I know as it does not exist. E.g. as a proposal
for a name 'CopyToTseClip( STRING s )

E.g.

PROC Main()
 STRING s[255] = "foobar"
 CopyToTseClip( s )
END

4. So at the moment one has to write a lot of rather superfluous TSE source code to get something equivalent (like I had to do in my recent TSE parser program), something like:

PROC Main()
INTEGER bufferI = 0
//
PushPosition()
bufferI = CreateTempBuffer()
PopPosition()
//
PushBlock()
PushPosition()
//
GotoBufferId( bufferI )
//
// put the string in the buffer and highlight it, then copy it to the TSE clipboard
BegLine() UnMarkBlock() MarkStream() EndLine() Left() MarkStream() Copy()
//
PopBlock()
PopPosition()
//
END

5. One can then to get it back e.g. somewhere else in your TSE program:

a. Use Paste() if using CopyToTseClip() (when it should exist)

b. Use CopyFromWinClip() if using CopyToWinClip()


Thanks
with friendly greetings
Knud van Eeden










knud van eeden

unread,
May 22, 2024, 7:47:06 PMMay 22
to SemWare TSE Pro Text Editor, S.E. Mitchell
Hello,
AddLine( s, bufferI )
//
BegLine() UnMarkBlock() MarkStream() EndLine() Left() MarkStream() Copy()
//
PopBlock()
PopPosition()
//
END

5. One can then to get it back e.g. somewhere else in your TSE program:

knud van eeden

unread,
May 22, 2024, 8:11:37 PMMay 22
to SemWare TSE Pro Text Editor, S.E. Mitchell
FYI:

>> Fred Olson wrote 5 April 2005
>>While you are at it, please also add
>>S = GetFromWinClip()

> Sammy Mitchell wrote 5 April 2005
> It turned out to be pretty simple, so I went ahead and
> implemented these commands.
>
> My personal copy now has the following new commands:
>
> boolean CopyToWinClip([string s])
>
> Copy a marked block to the Windows clipboard.

> If the optional string argument is included, it is copied to
> the Windows clipboard (instead of the block).
>
> boolean CopyToWinClipAppend([string s])
>
> Same as CopyToWinClip(), only it appends to the end of the text
> that already in the clipboard. If the clipboard is empty, then
> this command is identical to CopyToWinClip().
>
> string GetStrFromWinClip()
>
> returns up to 255 characters of the text that is in the Windows
> clipboard.

===

So this suggest if possible the following new commands, but now for the TSE clipboard:

>While you are at it, please also add
>S = GetFromTSEClip()

boolean CopyToTSEClip([string s])

Copy a marked block to the TSE clipboard.

If the optional string argument is included, it is copied to
the STRING clipboard (instead of the block).

boolean CopyToTSEClipAppend([string s])

Same as CopyToTSEClip(), only it appends to the end of the text
that already in the clipboard. If the clipboard is empty, then
this command is identical to CopyToTSEClip().

string GetStrFromWinClip()

returns up to 255 characters of the text that is in the TSE
clipboard.


Thanks

Hello,

a. Use GetStrFromTseClip() (less good using Paste()) if using CopyToTseClip() (when it should exist)

b. Use GetStrFromWinClip() (less good if using PasteFromWinClip()) if using CopyToWinClip()
Reply all
Reply to author
Forward
0 new messages