From: dh on
On 19.04.2010 08:49, Gehrmann wrote:
> I am using Mathematica 7 to analyze a large data set and have written
> a program which runs successfully when invoked as follows:
>
> analyzer["C:\\mdtp\\Jim\\Data\\Data\\Field07Aout.txt", "abc", "All",
> "All", "-9", "PT", "-9", "CC", "EQ", "1", "1", "No", "{1}"];
>
> However, I would like to create a button notebook which allows the
> user to change parameters and push a button once the desired
> parameters have been chosen. I've tried the following statements:
>
> Get["C:\\mdtp\\currentparameters.txt"]; (*reads the same parameters
> used above from a file*)
>
> Button["Click Here to Produce Summary and Question Analyses",
> analyzer[testnamex, sourcenm, specification, selecteddatnm,
> posttestcorr, posttestnm, coursecorr, coursecorrnm, equator,
> ToExpression[alph], ToExpression[bet], graffile, qtoshow]]
>
> which displays a button--on pushing the button the analyzer routine is
> invoked but doesn't complete--no error message is displayed. I
> believe that this button approach is exceeding some time or memory
> limit but haven't been able to determine which in order to make the
> button invocation method work. I would appreciate any help on this.
> Thanks.
>
Hi Gehrmann,
could it be that you forget to print the output?
Consider:
fun[x_] := 1/x;
Button["DoIt", fun[x]]
which displays nothing. However it works with the following change:
fun[x_] := 1/x;
Button["DoIt", Print(a)fun[x]]
Daniel

--

Daniel Huber
Metrohm Ltd.
Oberdorfstr. 68
CH-9100 Herisau
Tel. +41 71 353 8585, Fax +41 71 353 8907
E-Mail:<mailto:dh(a)metrohm.com>
Internet:<http://www.metrohm.com>


From: David Bailey on
Gehrmann wrote:
> I am using Mathematica 7 to analyze a large data set and have written
> a program which runs successfully when invoked as follows:
>
> analyzer["C:\\mdtp\\Jim\\Data\\Data\\Field07Aout.txt", "abc", "All",
> "All", "-9", "PT", "-9", "CC", "EQ", "1", "1", "No", "{1}"];
>
> However, I would like to create a button notebook which allows the
> user to change parameters and push a button once the desired
> parameters have been chosen. I've tried the following statements:
>
> Get["C:\\mdtp\\currentparameters.txt"]; (*reads the same parameters
> used above from a file*)
>
> Button["Click Here to Produce Summary and Question Analyses",
> analyzer[testnamex, sourcenm, specification, selecteddatnm,
> posttestcorr, posttestnm, coursecorr, coursecorrnm, equator,
> ToExpression[alph], ToExpression[bet], graffile, qtoshow]]
>
> which displays a button--on pushing the button the analyzer routine is
> invoked but doesn't complete--no error message is displayed. I
> believe that this button approach is exceeding some time or memory
> limit but haven't been able to determine which in order to make the
> button invocation method work. I would appreciate any help on this.
> Thanks.
>
I don't think there is enough information here to decide what is
happening, but I would guess that analyzer is being called with the
wrong arguments. If for example the definition of analyzer limits its
arguments to particular types - e.g. x_String - then if you call the
function with the wrong type of argument, nothing will happen.

Possible suggestions:

1) Put the whole notebook, plus input file somewhere on the internet,
and someone will probably determine what has gone wrong.

2) Test the code by calling Get and then calling analyzer without using
the button.

3) Add some Print commands to analyzer to determine if it is being
called, and how far it gets.

I don't think this problem is connected with running out of memory. If
the kernel runs out of memory, it will tell you.

David Bailey
http://www.dbaileyconsultancy.co.uk