THIS 22.1

Variables

Variables

Variable names can only have "a-z", "0-9" and "_" in them. Variables can be inserted anywhere in the script, FAST-TCF will replace any variables with their corresponding values before processing the line, for example:

define var output displacement
define var nod_id 12345678
define var xscale 0.001

node $nod_id $output x xscale $xscale

converts into:

node 12345678 displacement x xscale 0.001

Variable definitions can contain several words or other varaibles, and these will be joined together to form the final variable value, for example:

define var day 31st
define var month january
define var year 2099
define var date $day _ $month _ $year

creates the variable date with value 31st_january_2099

Because variables cannot have anything other than "a-z", "0-9" and "_" in them, it is possible to use variables within strings:

define var analysis run01_vers2

read january_$analysis.cur

converts into

read january_run01_vers2.cur

However, sometimes the user may want to insert a variable within other alphanumeric words, in these circumstances use a "$$" terminator to designate the end of the variable name:

define var analysis xyz_run01
read $analysis$$_x.cur

converts into

read xyz_run01_x.cur

There are several built in variables, and these depend on the system and command line used to run FAST-TCF, they can be checked on the dialogue T/HIS prints before starting:

$run_name This is the basename of the key file in for the 1st model directory (should there be one). If a script refers to multiple models then $run_name N (where N is the model number) can be used for each model.
$run_dir This is the full pathname of the directory containing the output files for a model. If a script refers to multiple models then $run_dir N (where N is the model number) can be used for each model.
$run_title This is the title of the analysis found in the output files. If a script refers to multiple models then $run_title N (where N is the model number) can be used for each model.
$ftcf_script This is the name of the FAST-TCF that is being run
$ftcf_script_dir This is the name of the directory containing the FAST-TCF that is being run
$ftcf_dir This is the name of the current working directory.
$ftcf_path This is the full pathname of the current working directory.
$ftcf_startin_dir This is the full pathname of the directory that T/HIS was started in.

FASTTCF called

=====================================================
Fasttcf script: C:\example\test.inp
tmp file: C:\example\other_folder\test.tmp
tcf file: C:\example\other_folder\test.tcf
report file: C:\example\other_folder\test.rep
$FTCF_SCRIPT variable: test.inp
$FTCF_SCRIPT_DIR variable: C:\example\
$FTCF_DIR variable: other_folder
$FTCF_PATH variable: C:\example\other_folder
$RUN_TITLE var: lg09 : Large Test 9: Belted sled test
$RUN_NAME var: new_lg09
$RUN_DIR var: E:\test\sled
$RUN_TITLE1 var: lg09 : Large Test 9: Belted sled test
$RUN_NAME1 var: new_lg09
$RUN_DIR1 var: E:\test\sled