MID - the modeling company Home Search Tcl Script Help Tcl Script Help Contact Support

Tcl Help Procedures


opteval_script

Purpose:

Initialize the script environment for the evaluation and make the library modules from which functions are to be used, known to the Tcl interpreter. A Tcl library module is hereby a subdirectory of $TCL_LIBRARY, which contains modules with Tcl procedures.

Synopsis:

opteval_script script lib ...

Arguments:
script Name of the script to be executed.
lib ... Any number of subdirectories of $TCL_LIBRARY. All Tcl procedures which are contained in the files of the subdirectory, can be used in the script.

opteval_start

Purpose:

Initialize the evaluation window and set the context variables.

Synopsis:

opteval_start [quick]

Arguments:
quick (optional) When quick is set, then the variables client, win and l_sel are not determined. With this, the execution time is optimized.
Result:

The evaluation info window is initialized. With opteval_verbose and opteval_silent the output of opteval_info can be forced resp. suppressed. Furthermore, the following variables are set and can be used globally in the script.

e_pm The server element of the model.
n_pm The name of the model.
log The server element of the logged in user.
usr User name
l_arg Arguments, the script is called with.
client Name of the application which has started the evaluation.
win The server element, which the window is based on from which the evaluation was started.
l_sel List of selected server elements in the application window.
Note:

The global variable pmk (model-kind) is used to check the model e_pm. In case e_pm, n_pm, log, win are not determined, then the variable must be deleted prior using the Tcl command unset.


opteval_end

Purpose:

Stops the output in the evaluation window yet the message, sent in varargs is still displayed. This procedure should be called at the end of an evaluation.

Synopsis:

opteval_end [varargs]

Arguments:
varargs (optional) The arguments correspond to the ones of inoInfo.
Result:

The actions, specified in varargs are executed.

The output window remains open and can be used again for the next evaluation.

The actions +clear, -clear, +pop and -pop change the settings of the information window as described in Extras/Options.


opteval_silent

Purpose:

The evaluation of this command causes that all following outputs of opteval_info are suppressed. With the command opteval_verbose this situation can be undone again.

Synopsis:

opteval_silent


opteval_verbose

Purpose:

The evaluation of this command undoes the effect of opteval_silent. All further outputs of opteval_info are displayed again.

Synopsis:

opteval_verbose


opteval_info

Purpose:

Displays report messages or file contents in the evaluation window. When opteval_silent is set, the output is suppressed.

Synopsis:

opteval_info varargs

Arguments:
varargs The arguments correspond to the ones of inoInfo.
Result:

The actions, specified in varargs are executed.

The actions +clear, -clear, +pop and -pop change the settings of the information window as described in Extras/Options.


opteval_progress

Purpose:

Displays a dot in the evaluation window. This command should be used in order to prevent in time consuming loops the impression that the application has hung up. The command does the same as inoevalProgress, except that no info window needs to be specified since the output is written into the evaluation window, initiated with opteval_start.

Synopsis:

opteval_progress [-newline]

Arguments:
-newline (optional) Determines, if a line break is to be performed prior.

opteval_option

Purpose:

This function is used to read the script arguments together with all its parameters. The passed argument list is reduced by the specified options and the parameters of the option are read out. Usually, all parameters of the given option are used but this can be influenced by using the readargs argument. Variable replacement does not take place as well as path' are not replaced (see opteval_pathoption).

Synopsis:

opteval_option l_arg optname vals [readargs]

Arguments:
l_arg Variable name of the argument string. These are usually the call arguments of the script (see opteval_start).
optname Name of the option to be read out (without '-').
If optname "" then the first argument is read out without searching for an option, beginning with '-'.
vals The return list. Here the parameters are entered.
readargs (optional) The number of parameters that are to be read out for the option optname. Hereby, the default value -1 denotes that all parameters are read till the beginning of the next option.
Result:

In case of a success the number of read parameters of the option is returned. In the argument vals, the desired number of parameters is written.

In case of an error, -1 is returned.

Example:

# Argument string: l_arg = "-lng CPP -dir C:\\tmp\\import"

opteval_option l_arg lng vals

# Then vals contains "CPP", and l_args
# is then "-dir C:\\tmp\\import".


opteval_pathoption

Purpose:

This function is used to read out script arguments which have a path as parameter and works similar to opteval_option. The default value for the number of option values, to be read out is 1. In addition, the option values are translated into path names which can be processed by Tcl. Hereby, also environment variables are expanded (notation: UNIX $var, DOS %var% or Tcl $env(var)).

Synopsis:

opteval_pathoption l_arg optname vals [readargs]

Arguments:

The arguments correspond to the ones of opteval_option.

Result:

In case of a success the number of read parameters of the option is returned. In the argument vals the desired number of parameters is written.

In case of an error, -1 is returned.

Example:

# Option string: l_arg = "-lng CPP -dir C:\\tmp\\import -inodir \$INODIR".

# After

opteval_pathoption l_arg dir vals

# comes in vals "C:/tmp/import" while l_arg is reduced to "-lng CPP -inodir \$INODIR".

# With variable replacement:

opteval_pathoption l_arg inodir vals

# then vals contains for example "/ino60/inodir"
# and in l_args "-lng CPP".