Thread View: net.math.stat
1 messages
1 total messages
Started by Paul Lutt
Wed, 19 Jun 1985 01:06
Problem with menu function in S
Author: Paul Lutt
Date: Wed, 19 Jun 1985 01:06
Date: Wed, 19 Jun 1985 01:06
49 lines
2777 bytes
2777 bytes
I am having a problem with a function in ``S'' and I am hoping someone
out there in netland has a solution. The S manual describes a function
called "menu" which allows the user to build simple menus of commands.
When we tried this function locally, we got the message: "Error: Function
menu not found". It turns out that the `Smakefile' for the menu function
is setup in such a fashion that the tools that build the list of available
functions skips the "menu" function. I modified the `Smakefile', changing
the first line from:
menu: menu.x plmenu.o
to:
menu: interface.o menu.x plmenu.o
This change satisfied the function-list builder, making the "menu" function
available to the user.
The next step was to try the "menu(items,actions)" example shown in the
S manual. This example displays the following menu:
1 - List Datasets in Work Directory
2 - List Datasets in Save Directory
3 - quit
Which one?
At this point, I tried to quit by answering "3". The system thought
for a bit and then come up with the following error message:
S terminating: bad address
At this point I spent a fair amount of time finding out how the menu
function goes about doing its job. It turns out that when I answer
"3", the corresponding action in the "action" dataset is written out to
a temporary file. In this particular case, the action is "q" for
quit. Once the temporary file has been written, S is put in a mode
where it reads its input stream from the temporary file. It is at this
point that things go sour. The temporary file is written successfully,
but when S goes to re-open it to read the command stream, it uses a
null string as the file name. This gives S a bunch of garbage to
interpret at commands, which fails miserably.
I've tried to figure out why the temporary file name gets lost, but I'm
stuck in a maze of m4 macros, ratfor subroutines, and sorted software glue.
Any help would be greatly appreciated.
--
Paul Lutt (206) 356-5059
John Fluke Mfg. Co.
P.O. Box C9090
Everett, WA 98206
{allegra,decvax!microsof,ssc-vax,ucbvax!lbl-csam,uw-beaver}!fluke!pwl
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads