Programmer Guide/Command Reference/ATTRIBUTES: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=== Overview ===
The <code>ATTRIBUTES</code> command retrieves a blank-separated list of attributes of a [[Programmer_Guide/Shell_Items|shell item]], or of variables available in a given context.
The <code>ATTRIBUTES</code> command retrieves a blank-separated list of attributes of a [[Programmer_Guide/Shell_Items|shell item]], or of variables available in a given context.
==Usage==
;<code>ATTRIBUTES <var>item</var></code>: returns the blank-separated list of all available attributes for the supplied [[Programmer_Guide/Shell_Items|shell item]] <var>item</var> or a list of variables available:
;<code>ATTRIBUTES GLOBAL</code>:returns a blank-separated list of all [[Programmer_Guide/Introduction#Global_Variables|global variables]]
;<code>ATTRIBUTES SHELL</code>:returns a blank-separated list of all [[Programmer_Guide/Introduction#Shell_Variables|shell variables]]


=== Usage ===
;<code>#list := ATTRIBUTES <var>item</var>|MACRO|SHELL|GLOBAL</code>: returns the blank-separated list of all available attributes for the supplied shell item <var>item</var> or a list of variables available:
:* in the current macro, if <code>ATTRIBUTES MACRO</code> is used;
:* in the current shell, if <code>ATTRIBUTES SHELL</code> is used;
:* globally, if <code>ATTRIBUTES GLOBAL</code> is used.


=== Example ===
=== Example ===

Revision as of 13:54, 27 April 2011

The ATTRIBUTES command retrieves a blank-separated list of attributes of a shell item, or of variables available in a given context.

Usage

ATTRIBUTES item
returns the blank-separated list of all available attributes for the supplied shell item item or a list of variables available:
ATTRIBUTES GLOBAL
returns a blank-separated list of all global variables
ATTRIBUTES SHELL
returns a blank-separated list of all shell variables


Example

#table := new table *
#list := ATTRIBUTES $#table
um 'The item attributes available for a table item are: $#list'
delete /Var #table

See also: The example script scripts\examples\reflection.sts demonstrates the use of the ATTRIBUTES command and some other possibilities to retrieve attributes and properties of shell items.


Navigation menu

Personal tools