Project

General

Profile

Actions

$var » History » Revision 1

Revision 1/8 | Next »
Per Amundsen, 08/11/2015 01:46 PM


Added in 1.9.0

$var(%var,[N])

Returns the Nth matching variable name.

Searched both local and global variables and can use wildcards for the %var name.

Parameters

%var - Variable to match.
[N] - If N = 0, number of matched variables (default), otherwise the Nth match. (optional)

Properties

.value - The variable value.
.local - $true if the variable is a local variable, otherwise $false.
.secs - Number of seconds until the variable is unset (if autounset is on).

Examples

; Create a variable
/set %Example Hello World

; Print number of variables matching '%Example*'
//echo -ag $var(%Example*, 0)

; Print the name and value from the first match.
//echo -ag $var(%Example*, 1) = $var(%Example*, 1).value

Updated by Per Amundsen over 9 years ago · 1 revisions

Also available in: PDF HTML TXT