Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors


Manual Reference Pages  - attr_addr (5)

NAME

attr/addr - Copy attribute value as node pointer

CONTENTS

Synopsis
Description
Error Handling
Examples
See Also
Author

SYNOPSIS

attr/addr write, ![object], attribute
attr/addr write, xvalue

DESCRIPTION

In the first synopsis form, copies the node pointer from the attribute assigned to the named object, storing the result in the write register. The register will then hold the type PSUNIT_TYPE_NODE.

In the second synopsis form, takes a PSUNIT_TYPE_XVALUE argument, copies the node pointer from the attribute value and stores the result in the write register.

The attribute argument may be the text name of the attribute, or a register pointing to the attribute definition obtained using attr/load (the register will hold the type PSUNIT_TYPE_ATTRDEF).

If the attribute has more than one value associated with it, a NULL will be returned in the write argument instead. In this case, you must use the attr/copy instruction instead to iterate the values. See attr_copy(5).

If your intention is to read attribute values so that they may be written to other attributes or objects, consider using the attr/direct or obj/clone instructions instead, which may be more suited to your needs and will be a generally more efficient way of copying attributes around.

ERROR HANDLING

A runtime error is generated if a named attribute does not exist in the schema or is not assigned to the object, a referenced object does not exist in the nexus, if an argument provided is the wrong type or the attribute value is not a node pointer.

EXAMPLES

The following demonstrates transferring a node pointer from a local psPointer variable called ’p’ into a register:

.main  
% Initialise the local variable with a pointer
% to the current context
attr/load P8, [psPointer]
var/local P0, P8, [i], PCTX

% Copy the node pointer into a register attr/addr P1, P0, P8

SEE ALSO

pal_commands(5), pal_registers(5), pal_indices(5), ps_attributes(5), attr_copy(5), attr_direct(5), obj_clone(5), attr_load(5), attr_index(5),
PROSE Assembly Language at prose.sourceforge.net.

AUTHOR

Copyright (c) 2002-2013 Mark R. Bannister <cambridge@users.sourceforge.net>.

This is free software and can be downloaded from prose.sourceforge.net; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


PAL 1.0 attr_addr (5) 26 January 2013
Generated by manServer 1.07 from man5/attr_addr.5 using man macros.