Programmer Guide/Command Reference/ATTRIBUTES: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
Line 8: Line 8:
;<code>ATTRIBUTES SHELL</code>:returns a blank-separated list of all [[Programmer_Guide/Introduction#Shell_Variables|shell variables]]
;<code>ATTRIBUTES SHELL</code>:returns a blank-separated list of all [[Programmer_Guide/Introduction#Shell_Variables|shell variables]]


;<code>ATTRIBUTES MACRO</code>:returns a blank-separated list of all [[Programmer_Guide/Introduction#Macros|local variables]] of the current macro or member function
;<code>ATTRIBUTES INSTANCE</code>:returns a blank-separated list of all [[Programmer_Guide/Introduction#Classes.2C_Instances|member variables]] of the instance. This command can only be used in member functions of a class.
==See also==


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

Revision as of 15:14, 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
ATTRIBUTES MACRO
returns a blank-separated list of all local variables of the current macro or member function
ATTRIBUTES INSTANCE
returns a blank-separated list of all member variables of the instance. This command can only be used in member functions of a class.

See also

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