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


Manual Reference Pages  - obj_clone (5)

NAME

obj/clone - Initialise a cloned object edit buffer

CONTENTS

Synopsis
Description
Error Handling
Examples
See Also
Author

SYNOPSIS

obj/clone write, ![target] <, write, ![target] ... >
obj/clone write, buffer <, write, buffer ... >

DESCRIPTION

Initialises new object edit buffers (see obj_def(5)) and populates with a list of cloned commands. The arguments are grouped in pairs of write and read:

write Register to store the next edit buffer in. The edit buffer will be defined by the next read argument.
![target] Read argument identifying the nexus object to clone. When cloning a nexus object, this instruction will set-up an edit buffer with the appropriate class add and attribute add commands that would be required to create a new identical object.
buffer Read argument identifying the edit buffer to clone. When cloning an edit buffer, this instruction will duplicate all commands in the edit buffer in the same order they appear.

ERROR HANDLING

A runtime error is generated if an object referenced in a read argument does not exist, or is the wrong type.

EXAMPLES

The following demonstrates how to clone an edit buffer to create multiple identical objects:

.main  
% Initialise an empty edit buffer
obj/def P0

% Add a class class/add P0, [psErrorType]
% Add an attribute attr/add P0, [description], [No such user or group]
% Clone the buffer obj/clone P1, P0
% Commit two new identical objects to nexus obj/commit [NoSuchUser], P0 obj/commit [NoSuchGroup], P1

The following example demonstrates how the same result can be achieved by cloning the new object after the commit, rather than cloning the edit buffer before the commit:

.main  
% Initialise an empty edit buffer
obj/def P0

% Add a class class/add P0, [psErrorType]
% Add an attribute attr/add P0, [description], [No such user or group]
% Commit the first new object to the nexus obj/commit [NoSuchUser], P0
% Clone the new object obj/clone P0, ![NoSuchUser]
% Commit a second identical object to nexus obj/commit [NoSuchGroup], P0

SEE ALSO

pal_commands(5), pal_registers(5), pal_indices(5), obj_def(5), obj_edit(5), obj_commit(5), obj_clear(5), class_add(5), class_del(5), attr_add(5), attr_del(5), attr_mod(5), attr_mvadd(5), attr_mvdel(5), attr_mvmod(5),
PROSE Assembly Language at prose.sourceforge.net.

AUTHOR

Copyright (c) 2002-2016 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 obj_clone (5) 29 April 2016
Generated by manServer 1.07 from man5/obj_clone.5 using man macros.