# $variable-names(5)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

$variable-names - Filtered variable name list

## SYNOPSIS

$variable-names VariableName

## DESCRIPTION

$variable-names must first be initialized to the required filter string, if the variable is evaluated before it is initialized the value will be set to "ABORT" and the command will fail.

The filter string can contain wild-card characters compatible with most file systems, namely:-

?

Match any character.

[abc]

Match character only if it is a, b or c.

[a-d]

Match character only if it is a, b, c or d.

[^abc]

Match character only if it is not a, b or c.

*

Match any number of characters.

Note that these are not the same characters used by exact(2m) mode.

Once initialized, evaluating $variable-names returns the name of the next variable which matches the filter until no more variables are found, in which case an empty string is returned.

## EXAMPLE

The following example prints out the name of all variables to the massage line one at a time. Note that &set(4) is used on the !while(4) statement to avoid evaluating $variable-names twice per loop.

    set-variable $variable-names "*"
    !while &not &seq &set #l0 $variable-names ""
        100 ml-write &cat "variable: " #l0
    !done

## NOTES

The list of variables is evaluated when the variable is initialized, variables defined after the initialization will not be included in the list. The list can contain the current buffer's buffer variables (See Variables(4) for more information on the different types of variables).

Using unset-variable(2) to delete a variable which are in the list, before it has be evaluated, will have undefined effects.

## SEE ALSO

list-variables(2), $command-names(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>