User Tools

Site Tools


jvs:fscan:manual:chapter1:stringsubst

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

jvs:fscan:manual:chapter1:stringsubst [2018/12/12 19:38]
voyvodic
jvs:fscan:manual:chapter1:stringsubst [2023/02/23 18:43]
Line 1: Line 1:
-**fScan Reference Manual, Chapter 1 (Topics): stringsubst** 
-===== string substitution -- Using string variables in fScan commands ===== 
- 
-Character string variables are identified by preceding the variable name with a '$' or '_' character. String variables are replaced by their text during command execution.  String variables can also be used to perform simple arithmetic functions.  String variables are most useful when writing scripted macros or creating menu commands, but they can be used anytime. 
- 
-There are 3 types of string variables: 
-  * 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 
- 
-Set USER variables using the [[jvs:fscan:manual:chapter2:set|SET]] command as:\\ 
-  \-set varb1 = value1 
-  \-set varb2 value2 
-  \-set accept varb3 "Enter VARB3 value" 
- 
-For example:\\ 
-   \-set myname "Henry" 
-   \-set fullname "Henry Higgens" 
-   \-set myage 42 
- 
-Variable names are identified by an initial '$' or '_' character. Either prefix can be used for any variable; the variable is replaced by its string value in both cases. For single-valued variables '$' and '_' behave identically. But if the variable contains multiple words (separated by spaces) then a single '$' variable argument in a command will be converted to multiple single-word arguments, whereas a '_' multi-word variable argument remains a single argument. 
- 
-To perform simple arithmetic simply follow a variable name with '+', '-', '*', or '/' and a number value (no spaces). For example 
-   \-set newage $myage+3 
-   \-echo Image center is $xdim/2 $ydim/2 $zdim/2 
- 
- 
-**See Also:**\\ 
- 
- 
-[[jvs:fscan|fScan Home]],  
-[[jvs:fscan:manual|fScan Manual]],  
-[[jvs:fscan:manual:chapter1|Topics]],  
-[[jvs:fscan:manual:help|Manual Help]] 
  
jvs/fscan/manual/chapter1/stringsubst.txt · Last modified: 2023/02/23 18:43 (external edit)