Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
jvs:fscan:manual:chapter4 [2011/10/29 16:31] voyvodic |
jvs:fscan:manual:chapter4 [2023/02/23 18:43] (current) |
fScan supports several different types of internal variables. Values of some variables are global -- they do not change when you move from one active window to another. Other variables are workspace or data set specific -- their values will change depending on which window is currently active. | fScan supports several different types of internal variables. Values of some variables are global -- they do not change when you move from one active window to another. Other variables are workspace or data set specific -- their values will change depending on which window is currently active. |
| |
* [[jvs:fscan:manual:chapter4:strings|Global string variables]] | * [[jvs:fscan:manual:chapter4:global|Global variables]] |
* [[jvs:fscan:manual:chapter4:control|Global control variables]] | |
* [[jvs:fscan:manual:chapter4:uservarbs|User-defined variables]] | * [[jvs:fscan:manual:chapter4:uservarbs|User-defined variables]] |
* [[jvs:fscan:manual:chapter4:datasetvarbs|Data-set number variables]] | * [[jvs:fscan:manual:chapter4:datasetvarbs|Data-set variables]] |
* [[jvs:fscan:manual:chapter4:datasetstrings|Data-set string variables]] | * [[jvs:fscan:manual:chapter4:datasetstrings|Data-set string variables]] |
* [[jvs:fscan:manual:chapter4:datasetarrays|Data-set array variables]] | * [[jvs:fscan:manual:chapter4:datasetarrays|Data-set array variables]] |
| |
==== Accessing data variables ==== | ==== Accessing data variables ==== |
In general, data variable values can be accessed by specifying the name of the variable, preceded by the'$' character. For example:\\ | In general, data variable values can be accessed by specifying the name of the variable, preceded by the '$' character (or '_' character to make command-line scripting easier). To get the status of a variable, substitute '?' for '$'; the status is -1 if the named variable is not defined, it is 0 if it is defined but empty, and it is a positive value (the size of the variable) if it is defined and not empty. |
-echo Window: $thiswin WorkSpace $wsnum ; display name of current active window | |
| |
|listitem| | |
|listflag| | |
| |
| Variable operators: |
| * $varbname - the value of the named variable (_varbname works the same) |
| * ?varbname - the status of the named variable (0=undefined, 1=defined) |
| |
| For example:\\ |
| * -echo Window: $thiswin WorkSpace $wsnum ; display name and workspace of current active window |
| * -echo Varb: ?curdir ?thiswin ?myvarb ; test whether these variables are defined |
| |
**See Also:**\\ | The '$' character is also used to identify fScan special functions of the form: $funcname(). Examples are: |
[[jvs:fscan:manual:chapter2:set|Set command]] | * $exists(filename) - does the named file exist (0=no, 1=regular file, 2=directory)? |
| * $filepath(filename) - return the full path to the named file |
| * $relpath(filename) - return the relative path (from $curdir) |
| * $date(filename) - return a string containing the file modification date (yyyymmddhhmmss) |
| * $age(filename) - return the age of the named file in seconds |
| |
| * tables |
| * listitem |
| * listflag |
| |
| |
| |
| **See Also:**\\ |
| [[jvs:fscan:manual:chapter2:set|Set]], [[jvs:fscan:manual:chapter2:if|If]], and [[jvs:fscan:manual:chapter2:echo|Echo]] commands.\\ |
[[jvs:fscan|fScan Home]], | [[jvs:fscan|fScan Home]], |
[[jvs:fscan:manual|fScan Manual]], | [[jvs:fscan:manual|fScan Manual]], |
[[jvs:fscan:manual:help|Manual Help]] | [[jvs:fscan:manual:help|Manual Help]] |
| |