next up previous contents
Next: Reusing A_C modules Up: A USERS GUIDE Previous: Creating an Executable

Running an Executable

AC++ uses TCL/TK as its interpreter. There is a lot of information about TCL/TK on the web. Each line in TCL is a command (they can be concatinated together with semi-colons) that begins with a verb and takes either a number of arguments or a sub-command with arguments. The following is an example AC++ tcl session:

#  The following line defines a path called ``SamplePath''.  When this
#  path is run on an event ParmExample1 then ParmExample2 then user's event
#  operations will be called.
path create SamplePath ParmExample1 ParmExample2 user

#  This shows information about all defined paths
path list

#  This paragraph talks to the FileInput module and defines its input file.
module talk FileInput
   input file $env(VAL_DATA_DIR)/a75866aa_10.raw$
exit

#  This paragraph talks to the ParmExample1 module in order to change the
#  value of parm1.  ``parm1 list'' shows its current value.
module talk ParmExample1
   parm1 set 106
   parm1 list
exit

#  This paragraph talks to the FileOutput module and defines its output file.
#  The ``create'' command defines a new stream called ``test_stream'' and
#  associates the file ``test.dat'' with that stream.  The next line associates
#  test_stream with the path SamplePath.  If path SamplePath had any filters
#  in it then only events which successfully completed the entire path would
#  be output to the test.dat file.  Since SamplePath does not have any filters
#  all events successfully read in will be written to test.dat.
module talk FileOutput
   output create test_stream test.dat
   output path test_stream SamplePath
   output list
exit

#  This line begins processing events.  Note that you may optionally provide
#  a number of events to process with a ``-nev #events'' qualifier added to
#  the end of this line.
ev begin

#  This command terminates this process.
exit
If the above is put into a file with an extension of .tcl then this file can be specified as an argument to any AC++ executable and it's contents will be executed as if they had been entered in a the command prompt. See the commands Reference Manual for a complete listing of all of the available commands.

Liz Sexton
Fri May 16 16:37:56 CDT 1997