[S] Re: summary of braces: editing functions

Mark Bravington FSMG CEFAS (M.V.BRAVINGTON@cefas.co.uk)
Mon, 26 Oct 1998 09:38:12 +0000

(By way of reply to "dave" who creates functions in ESS and sources them in, but is interested in other ways):

For Splus 4.0 & 4.5 under Windows, I have a system for interfacing a multi-window text editor with Splus. This allows you to issue a command from Splus, e.g.

> fixtp( myfunc)
> # now you can carry on in Splus while "myfunc" is loaded into the editor

When you've finished editing "myfunc", use the editor to launch a stand-alone program that sends a DDE command back to Splus, telling Splus to load the new code. I have this program linked to a hotkey in the editor. In your Splus window, something like this automatically appears:

> end.fix( 'C:\\TEMP\\MYFUNC')
myfunc has been edited OK

The editing process is pretty seamless, and since you can edit several functions at once, it is easy to cut'n'paste code around, etc. Best of all, your source code is preserved exactly, with your own layout, comments where you want them, etc. It will print nicely in Splus, just the way you wrote it. The system works even if your code doesn't parse correctly (though obviously the function won't run). The code is displayed with a warning, and the next time you edit the function, the editor will place you at the spot where Splus found a problem. There is an automatic backup facility too, though it's a bit klunky.

I have tested this with Programmer's File Editor PFE (which is free and good) and TextPad (which is even better IMO, but you do have to pay for it). It should be easy to customize the approach for other respectable editors. The fiddly part is setting up the editor to launch the DDE talk-to-Splus program.

This is a perennial topic on S-news, and there are other approaches. I believe Frank Harrell compiled a list a while back (NB that my technique post-dates Frank's list). Also, someone (can't remember who, sorry) recently announced a system that maintains and edits separate text files away from the Splus source. My approach does have the advantage that the formatted source code is stored with the Splus object, so porting stuff is easy.

Let me know if you would like a copy of the stuff. There are a number of others using this setup besides myself, and they seem to like it, or at any rate are too polite to complain.

Mark Bravington

This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news