Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors
attr/def - Define encoded data value
Synopsis
Description
List Sequences
Importing Values
Error Handling
Examples
See Also
Author
attr/def write, attribute, value
attr/def write, xvalueattr/import write, attribute, value
Takes a given data value and encodes it according to the syntax of the given attribute, storing the result as a PSUNIT_TYPE_XVALUE in the write register.
The attribute is either a text argument containing the name of the object attribute to add, or a PSUNIT_TYPE_ATTRDEF register returned by the attr/load instruction.
The value is an argument containing the data to encode. If value is a register containing the type PSUNIT_TYPE_STRING or PSUNIT_TYPE_LIST and the instruction does not generate an error, then the register will be cleared as the byte string is now referenced elsewhere.
If value is a register containing the type PSUNIT_TYPE_XVALUE, the encoded data is duplicated in the same fashion as with the attr/direct instruction. See attr_direct(5).
If xvalue is provided as the second argument and the value is omitted, then the encoded value is duplicated in the resulting write register.
If value is a list sequence provided via @[ ... ] notation and the list contained registers of type PSUNIT_TYPE_STRING or PSUNIT_TYPE_XVALUE, then upon successful completion of this instruction the source registers will be cleared as the data is now referenced elsewhere.
The attr/import instruction is identical to attr/def except that value must be binary data represented as a PSUNIT_TYPE_STRING and previously exported from the same attribute type with attr/export.
A runtime error is generated if an argument is of the wrong type, or if a named attribute does not exist in the schema.
attr/def P7, [psIndex], #53 Creates an encoded data value using the psIndex attribute syntax for the numeric value 53. The result will be stored in the register P7. attr/def PUSH, [psString], P7 Re-encode the encoded data value in register P7 using the psString attribute syntax instead, pushing the new data onto the program stack.
pal_commands(5), pal_registers(5), pal_indices(5), attr_direct(5), attr_load(5), attr_xcopy(5), attr_export(5), reg_copy(5), ps_attributes(5),
PROSE Assembly Language at prose.sourceforge.net.
Copyright (c) 2002-2018 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_def (5) | 25 January 2018 |