Topics

Writing plug-in utilities

J.G.Harston
 

I'm sure I knew how to do this, but it's one of those things that
I was sure I had notes on, and looking through everything and
searching everything I could think of oneline, I can't find anything.

How do you structure a program so you can add it to the Utilities
menu? And, how does that utitlity "see" the program in the IDE?

--
J.G.Harston - jgh@... - mdfs.net/jgh

Richard Russell
 

On Sun, Feb 3, 2019 at 11:19 PM, J.G.Harston wrote:
How do you structure a program so you can add it to the Utilities
menu? And, how does that utitlity "see" the program in the IDE?
In BB4W or BBCSDL?  Or both?  They are significantly different in that regard (particularly the second part of your question).

J.G.Harston
 

Richard Russell wrote:
In BB4W or BBCSDL? Or both? They are significantly different in
that regard (particularly the second part of your question).
Primarily BB4W, I was sure I'd archived information you and/or Jon
Ripley had posted on a predecessor group/forum/something, but
searching everywhere failed to find anything. I found several posts
asking for suggestions of utilities and volunteers to write them,
though. ;)

I had a look at the BBSDL utilities and think I worked out how they
work, but

The utility I have sketched out is "Run in [BeebEm|BEm|Other]",
the functionality would be: create $tmp$+name.ssd, write a catalog,
write the program in Acorn format, issue OSCLI BeebEm$+" "+disk$

--
J.G.Harston - jgh@... - mdfs.net/jgh

Richard Russell
 

On Mon, Feb 4, 2019 at 04:11 PM, J.G.Harston wrote:
Primarily BB4W, I was sure I'd archived information you and/or Jon
Ripley had posted on a predecessor group/forum/something,
Yes, I'm sure there should be something but it must be going back several years.  In BB4W the easiest way to install a new add-in utility is to use Malcolm's 'My Utilities' add-in (slot 9, by default): click on the 'Manager' button then select an existing utility to replace or (probably better) one of the 'empty' slots, then 'Edit'.  You can then enter the details of the utility you have written.

Getting at the program currently in the editor is somewhat trickier.  You are passed the handle of the editor window (pane) in the command line, which you can then use to communicate with it using the normal Windows messaging system.  It's a custom control, and whilst it responds to a few of the standard Text Edit messages it's only a small subset (and not always in a fully compatible way).

Taking the Cross Reference utility as a (topical) example, it first sends an EM_GETLINECOUNT message to retrieve the total number of lines, and then sends an EM_GETLINE message for each one.  The returned program lines are plain text, of course, and will need to be tokenised (but for your application you probably want to do that yourself anyway).

Does that give you enough information to make progress?