[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [StrongED] OSCLI question
In message <55801803c9bob@xxxxxxxxxxxxxxxx>
Bob Latham <bob@xxxxxxxxxxxxxxxx> wrote:
> In article <5563158055.gavin@xxxxxxxxxxxxxxx>,
> Gavin Wraith <gavin@xxxxxxxxxxxxxxx> wrote:
> > In message <55800f95d8bob@xxxxxxxxxxxxxxxx>
> > Bob Latham <bob@xxxxxxxxxxxxxxxx> wrote:
> > >I was mistakenly under the impression that pointing R0 at a path string
> > >with a text file as the leaf name would be the equivalent of double
> > >clicking the file. If I double click the file it will load into
> > >StrongEd which is already loaded or if not loaded, will load it and
> > >then open in it.
> > >
> > >Not so OSCLI. OSCLI always loads another copy of StrongEd and gives the
> > >warning that it is already running.
> > >
> > >Is there an easy way around this to get the same effect as a double
> > >click.
> > I believe the standard way to achieve this is to start up a task which
> > broadcasts a DATALOAD message (see page 3-253 of PRMs) with R1+44
> > being the address of a zero-terminated string holding the pathname
> > of the file; and, in your case, R1+40 holding &FFF.
> Thanks for the help.
> Oh dear. I hate writing 'message' code it gets so involved with
> acknowledges etc. avoid at all cost life is too short. :-)
> Also, presumably I'm then locked to the text file popping up in StrongEd
> alone and not the current text editor.
No, if you broadcast a DataOpen message then it will be picked up be
the first running application that can handle the given filetype. This
would normally the current text editor but if there's more than 1 app
that can handle the filetype then it may open in the wrong one.
> Is there not an easier way to get the current text editor to open a text
> file ?
Yes, as Martin has already pointed out; you use *Filer_Run <filename> .
This will broadcast the DataOpen message for you.
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx
List archives at http://www.Torrens.org.uk/RO/StrongED/index.html