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


Manual Reference Pages  - attr_del (5)

NAME

attr/del - Delete attribute directly or via edit buffer

CONTENTS

Synopsis
Description
Multi-value Attributes
Error Handling
Atomicity
Examples
See Also
Author

SYNOPSIS

attr/del ![object], attribute <, attribute ... >
attr/del buffer, attribute <, attribute ... >

DESCRIPTION

In the first synopsis form, performs a direct edit, deleting attribute from the specified object.

In the second synopsis form, inserts attribute delete instructions to an object edit buffer. When the buffer is committed against a nexus object using obj/commit, the instructions are processed and the specified list of attributes will be removed from the object.

The object edit buffer identified by the buffer argument will have been previously initialised by obj/def, obj/clone or obj/edit.

One or more attribute arguments may be provided, and are either text arguments containing the names of the object attributes to remove, or PSUNIT_TYPE_ATTRDEF registers returned by the attr/load instruction.

MULTI-VALUE ATTRIBUTES

The entire attribute will be removed regardless of how many values may be assigned to it. To remove specific attribute values only, use the attr/mvdel instruction instead (see attr_mvdel(5)).

ERROR HANDLING

A runtime error is generated if an argument is of the wrong type, if a named attribute does not exist in the schema, or if a referenced object does not exist in the nexus.

An error will also occur if a direct edit would break the schema. At this time schema checking is limited to testing for the SINGLE-VALUE parameter, i.e. if an attempt is made to add a second value to an attribute that does not permit multiple values.

Note that requests to remove attributes that are defined in the schema but not assigned to the object will be silently discarded.

ATOMICITY

This instruction is not atomic. If multiple attributes are to be deleted, it is possible for the first to succeed and the second to fail. No attempt is made to roll back changes in the event of an error.

EXAMPLES

The following demonstrates the use of an edit buffer for removing multiple attributes from a nexus object:

.main  
% Edit an existing node
obj/edit P0, ![BookStore]

% Remove a list of attributes attr/del P0, [name], [author]
% Commit changes obj/commit P0

SEE ALSO

pal_commands(5), pal_registers(5), pal_indices(5), obj_def(5), obj_clone(5), obj_edit(5), obj_commit(5), attr_add(5), attr_mod(5), attr_mvadd(5), attr_mvdel(5), attr_mvmod(5), attr_load(5), ps_attributes(5),
PROSE Assembly Language at prose.sourceforge.net.

AUTHOR

Copyright (c) 2002-2012 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_del (5) 26 January 2012
Generated by manServer 1.07 from man5/attr_del.5 using man macros.