This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
jvs:fscan:manual:chapter1:stringsubst [2014/08/04 16:03] 127.0.0.1 external edit |
jvs:fscan:manual:chapter1:stringsubst [2023/02/23 18:43] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
**fScan Reference Manual, Chapter 1 (Topics): stringsubst** | **fScan Reference Manual, Chapter 1 (Topics): stringsubst** | ||
- | ===== stringsubst | + | ===== string substitution |
- | | + | Character |
- | If MAXC > 0, substitution is done in-place. | + | |
- | variable: | + | There are 3 types of string variables: |
- | ${varbname} | + | * preset global variables - fScan control variables (e.g. $fscanhome, $opsys) |
+ | * data descriptor variables - current image meta-data (e.g. $tr, $xdim) | ||
+ | * user-defined variables - obvious | ||
- | variable+const | + | Set USER variables using the [[jvs: |
- | variable-const | + | set varb1 = value1 |
- | variable*const | + | set varb2 value2 |
- | variable/ | + | set accept varb3 "Enter VARB3 value" |
- | varbname: varbname | + | For example:\\ |
- | | + | set myname |
- | + | set fullname | |
- | [rest has not been implemented yet] | + | set myage 42 |
- | dataname:: | + | |
- | xmlspec | + | |
- | dataname: | + | |
- | filename | + | |
- | xmlspec: | + | |
- | namespace: | + | |
- | xmlspec/ | + | |
- | xmlspec/ | + | |
- | xmlspec[numvalue] | + | |
- | attribute: | + | |
- | | + | |
- | + | ||
- | +: not standard XPath | + | |
- | + | ||
- | + | ||
- | Examples: | + | |
- | $taskname | + | |
- | $xdim/2 | + | |
- | + | ||
- | ${mrfile:: | + | |
- | + | ||
- | Set USER variables using the -SET command as: | + | |
- | -set uservarb = value | + | |
- | -set uservarb value | + | |
+ | Variable names are identified by an initial ' | ||
+ | To perform simple arithmetic simply follow a variable name with ' | ||
+ | set newage $myage+3 | ||
+ | echo "Image center location is:" $xdim/2 $ydim/2 $zdim/2 | ||
**See Also:**\\ | **See Also:**\\ | ||
+ | [[jvs: | ||
[[jvs: | [[jvs: |