Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #5667 > unrolled thread
| Started by | Jim Nagel <jnews18c@abbeypress.co.uk> |
|---|---|
| First post | 2019-01-02 15:40 +0000 |
| Last post | 2019-01-04 02:31 +0100 |
| Articles | 8 — 6 participants |
Back to article view | Back to comp.sys.acorn.programmer
loading the clipboard Jim Nagel <jnews18c@abbeypress.co.uk> - 2019-01-02 15:40 +0000
Re: loading the clipboard Ronald <gettingchoppy@gmail.com> - 2019-01-03 08:50 +1300
Re: loading the clipboard Jim Nagel <jnews18c@abbeypress.co.uk> - 2019-01-03 15:23 +0000
Re: loading the clipboard Alan Wrigley <usenet@alanwrigley.me.uk> - 2019-01-03 17:09 +0000
Re: loading the clipboard Andrew Conroy <a.m.conroy@owlart.co.uk> - 2019-01-03 21:53 +0000
Re: loading the clipboard Alan Wrigley <usenet@alanwrigley.me.uk> - 2019-01-03 22:45 +0000
Re: loading the clipboard Steve Fryatt <news@stevefryatt.org.uk> - 2019-01-03 23:13 +0000
Re: loading the clipboard Fred Graute <fjgraute@planet.nl> - 2019-01-04 02:31 +0100
| From | Jim Nagel <jnews18c@abbeypress.co.uk> |
|---|---|
| Date | 2019-01-02 15:40 +0000 |
| Subject | loading the clipboard |
| Message-ID | <19191f7057.jim@6.abbeypress.net> |
From within a program, is there a way of loading a specified string onto the clipboard? It used to be possible in Ro4.39 but the routine I had there does not work in Ro5. I'd want to do this from within Basic or a Datapower script, or perhaps a PHP script. The intention is that the user can then use Ctrl-V to paste the string into a dialogue field of some other application. For example, generate an address to paste onto a envelope for printing, or generate an email address to paste into the email client. -- Jim Nagel www.archivemag.co.uk >> "From" address is genuine but will change. Website has current one.
[toc] | [next] | [standalone]
| From | Ronald <gettingchoppy@gmail.com> |
|---|---|
| Date | 2019-01-03 08:50 +1300 |
| Message-ID | <7f09367057.beeb@-.-> |
| In reply to | #5667 |
In message <19191f7057.jim@6.abbeypress.net>
Jim Nagel <jnews18c@abbeypress.co.uk> wrote:
> From within a program, is there a way of loading a specified string onto
> the clipboard?
>
> It used to be possible in Ro4.39 but the routine I had there does not work
> in Ro5.
>
> I'd want to do this from within Basic or a Datapower script, or perhaps a
> PHP script.
>
> The intention is that the user can then use Ctrl-V to paste the string
> into a dialogue field of some other application. For example, generate an
> address to paste onto a envelope for printing, or generate an email
> address to paste into the email client.
>
I have used Typer by Martin Bazely for something similar in the past.
http://www.starfighter.acornarcade.com/mysite/utilities.htm
I think it is as simple as writing the text file it expects to find in
<Wimp$ScrapDir>.Typer.File You have to click on the icon to deposit the
text at the focus though. The intended design of dragging some text to
the iconbar icon is pretty handy as a bonus.
Written in BASIC, probably many areas of interest to you.
Ronald M.
[toc] | [prev] | [next] | [standalone]
| From | Jim Nagel <jnews18c@abbeypress.co.uk> |
|---|---|
| Date | 2019-01-03 15:23 +0000 |
| Message-ID | <9c6da17057.jim@6.abbeypress.net> |
| In reply to | #5667 |
Jim Nagel wrote on 2 Jan:
> From within a program, is there a way of loading a specified string onto
> the clipboard? It used to be possible in Ro4.39 but the routine I had
> there does not work in Ro5.
Found the routine I was using on the RiscPC (4.39). It used
SYS "ClipboardHolder_Copy" ,0,&FFF,A$,L%
but RiscOS 5 does not (yet) provide that SYS call.
Could it be added? Would surely be widely useful.
Meanwhile my workaround is to write the string to a scrap file and cause
it to open as a tiny filer window, from whence file can be dragged to the
required location. (Ctrl-V in the Ro4 clipboard routine was neater.)
--
Jim Nagel www.archivemag.co.uk
>> "From" address is genuine but will change. Website has current one.
[toc] | [prev] | [next] | [standalone]
| From | Alan Wrigley <usenet@alanwrigley.me.uk> |
|---|---|
| Date | 2019-01-03 17:09 +0000 |
| Message-ID | <gemini.pkrmbo00fubap0244.usenet@alanwrigley.me.uk> |
| In reply to | #5670 |
Jim Nagel <jnews18c@abbeypress.co.uk> wrote: > Found the routine I was using on the RiscPC (4.39). It used > SYS "ClipboardHolder_Copy" ,0,&FFF,A$,L% > but RiscOS 5 does not (yet) provide that SYS call. > Could it be added? Would surely be widely useful. The Clipboard Holder module is specific to the RO4/6 branch of the OS. For RO5 you have to use the standard clipboard protocol as devised by Acorn which involves claiming the clipboard and then responding to requests for the current clip. This document describes how it works: http://chrisacorns.computinghistory.org.uk/docs/Acorn/AN/240.pdf Alan -- RISC OS - you know it makes cents
[toc] | [prev] | [next] | [standalone]
| From | Andrew Conroy <a.m.conroy@owlart.co.uk> |
|---|---|
| Date | 2019-01-03 21:53 +0000 |
| Message-ID | <5770c51320a.m.conroy@owlart.co.uk> |
| In reply to | #5671 |
In article <gemini.pkrmbo00fubap0244.usenet@alanwrigley.me.uk>,
Alan Wrigley <usenet@alanwrigley.me.uk> wrote:
> Jim Nagel <jnews18c@abbeypress.co.uk> wrote:
> > Found the routine I was using on the RiscPC (4.39). It used
> > SYS "ClipboardHolder_Copy" ,0,&FFF,A$,L%
> > but RiscOS 5 does not (yet) provide that SYS call.
> > Could it be added? Would surely be widely useful.
> The Clipboard Holder module is specific to the RO4/6 branch of the OS.
> For RO5 you have to use the standard clipboard protocol as devised by
> Acorn which involves claiming the clipboard and then responding to
> requests for the current clip. This document describes how it works:
> http://chrisacorns.computinghistory.org.uk/docs/Acorn/AN/240.pdf
The downside to this method is that the clipboard contents are only
preserved whilst the app that put them there is active. If you quit the
app, it takes the clipboard with it. This means Jim can't have a 'script'
to put something onto the clipboard, he needs a full Wimp application
that stays running and responds to User Messages.
A truly global clipboard would preserve the contents even after the app
quits.
Andrew
--
+----------------------------------------+---------------------------------+
| Andrew Conroy, Owl-Art Un-Ltd. | email: a.m.conroy@argonet.co.uk |
| Coming to you on an Acorn RiscPC SA110 | |
+----------------------------------------+---------------------------------+
The impossible I can do at once, miracles take a little longer!!
[toc] | [prev] | [next] | [standalone]
| From | Alan Wrigley <usenet@alanwrigley.me.uk> |
|---|---|
| Date | 2019-01-03 22:45 +0000 |
| Message-ID | <gemini.pks1va00ru3rr0244.usenet@alanwrigley.me.uk> |
| In reply to | #5672 |
Andrew Conroy <a.m.conroy@owlart.co.uk> wrote: > A truly global clipboard would preserve the contents even after the app > quits. Indeed. It wouldn't be too hard to write a RO5 replacement for the Clipboard Holder. In fact, if Jim wants this feature purely for his own use he could always use UniServer, which effectively does that for its UniClip function. Alan -- RISC OS - you know it makes cents
[toc] | [prev] | [next] | [standalone]
| From | Steve Fryatt <news@stevefryatt.org.uk> |
|---|---|
| Date | 2019-01-03 23:13 +0000 |
| Message-ID | <mpro.pks36800s2ka703q3.news@stevefryatt.org.uk> |
| In reply to | #5673 |
On 3 Jan, Alan Wrigley wrote in message
<gemini.pks1va00ru3rr0244.usenet@alanwrigley.me.uk>:
> Indeed. It wouldn't be too hard to write a RO5 replacement for the
> Clipboard Holder. In fact, if Jim wants this feature purely for his own
> use he could always use UniServer, which effectively does that for its
> UniClip function.
A Clipboard module already exists for RISC OS 5, written by Fred Graute many
years ago: Jim simply needs the Clipboard_PutClip SWI, as far as I can see.
I'm not quite clear where the module is in current distributions, however,
so Jim probably wants to ask this question on the ROOL forum.
--
Steve Fryatt - Leeds, England
http://www.stevefryatt.org.uk/
[toc] | [prev] | [next] | [standalone]
| From | Fred Graute <fjgraute@planet.nl> |
|---|---|
| Date | 2019-01-04 02:31 +0100 |
| Message-ID | <6010d97057.fjgraute@casema.nl> |
| In reply to | #5670 |
In message <9c6da17057.jim@6.abbeypress.net>
Jim Nagel <jnews18c@abbeypress.co.uk> wrote:
> Jim Nagel wrote on 2 Jan:
>
> > From within a program, is there a way of loading a specified string onto
> > the clipboard? It used to be possible in Ro4.39 but the routine I had
> > there does not work in Ro5.
>
> Found the routine I was using on the RiscPC (4.39). It used
> SYS "ClipboardHolder_Copy" ,0,&FFF,A$,L%
> but RiscOS 5 does not (yet) provide that SYS call.
> Could it be added? Would surely be widely useful.
For RO5 you can use the Clipboard module. It's currently not available
from the ROOL website but there is a copy in !MiniTime.
The code to use it should be something like this:
String$ = "Test global clipboard"
Length% = LEN(String$)
Leafname$ = "TestClip"
SYS "XClipboard_Put",0,&FFF,String$,Length%,Leafname$,0 TO ;Flags%
IF ((Flags% AND 1) = 1) THEN
SYS "XClipboardHolder_Copy",0,&FFF,String$,Length%
ENDIF
You'll also need to make sure that the Clipboard module is loaded when
ClipboardHolder is absent. Either in the BASIC program or an Obey file.
HTH
--
Fred Graute
http://www.stronged.iconbar.com/
[toc] | [prev] | [standalone]
Back to top | Article view | comp.sys.acorn.programmer
csiph-web