Project

General

Profile

$var » History » Version 1

Per Amundsen, 08/11/2015 01:46 PM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*$var(%var,[N])*
4
5
Returns the Nth matching variable name.
6
7
_Searched both local and global variables and can use wildcards for the %var name._
8
9
*Parameters*
10
11
%var - Variable to match.
12
[N] - If N = 0, number of matched variables (default), otherwise the Nth match. (optional)
13
14
*Properties*
15
16
.value - The variable value.
17
.local - [[$true]] if the variable is a local variable, otherwise [[$false]].
18
.secs - Number of seconds until the variable is unset (if autounset is on).
19
20
*Examples*
21
22
<pre>
23
; Create a variable
24
/set %Example Hello World
25
26
; Print number of variables matching '%Example*'
27
//echo -ag $var(%Example*, 0)
28
29
; Print the name and value from the first match.
30
//echo -ag $var(%Example*, 1) = $var(%Example*, 1).value
31
</pre>