Hi Ted,
Sorry it took me a while to respond.
ExecuteAFile can be passed a list of arguments in the order that you want them to be used. The basic use is
Code:inputArguments = {"00": "first argument", "01":"second argument"};
ExecuteAFile ("/path/to/some/batch/file", inputArguments);
Also, take a look at section 2.8 in Multimedia File Viewing and Clickable Links are available for Registered Members only!! You need to
Four further points are
- keys in inputArguments will be read in lexicographic order, so if the number of arguments exceeds ten, use "00","01",..."09","10", not "0","1",..."10", lest argument "10" be processed right after argument "1".
- all values (e.g. "first argument") must be strings; if you want to pass numbers, simply convert them to strings.
- if you pass a blank value ("") for one of the keys, then HyPhy will prompt the user to input that value interactively -- this can permit you to "prefill" most of the options, but leave one or two to be supplied at run time (e.g. the file name)
- the input is case-sensitive; this is especially important when you are supplying options for multiple choice questions.
The logic behind this is that ExecuteAFile is meant to simulate the functionality of the input redirect operation in UNIX by simply supplying a list of strings that normally would come from the standard input.
ExecuteAFile does not return any values, but whatever values the batch file you call populates will be available to you after the call. For example if you have file1.bf:
Code:pi = 3.1415;
then
Code:ExecuteAFile ("file1.bf");
fprintf (stdout, "\n", pi, "\n");
should print out "3.1415".
Sergei