Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors
attr/cmp - Compare two attribute values
Synopsis
Description
Error Handling
Examples
See Also
Author
attr/cmp ![obj1], attr1, ![obj2], attr2
Compares attribute attr1 assigned to object obj1 with attribute attr2 assigned to object obj2, storing the result of the comparison in the SCMP and SFLG registers.
The attribute arguments may be the text name of the attributes, or registers pointing to the attribute definition obtained using attr/load (the register will hold the type PSUNIT_TYPE_ATTRDEF).
If the attr1 and attr2 arguments dont refer to the same attribute type (and the attribute data is encoded using a different syntax), then the second attribute data will be temporarily re-encoded to match the first syntax before the comparison can be performed. This re-encoding takes place via a byte string representation.
If identical attribute types are to be compared, consider using the obj/cmp instruction instead. See obj_cmp(5).
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 if attribute data could not be re-encoded in order to normalize the data syntax.
attr/cmp P0, [psString], P1, [psIndex] Compares the psString and psIndex attributes assigned to two objects pointed to by registers P0 and P1. The psIndex attribute will be re-encoded as a psString before the comparison is performed.
pal_commands(5), pal_registers(5), pal_indices(5), ps_attributes(5), ps_errortypes(5), obj_cmp(5), attr_test(5), attr_mvtest(5), reg_cmp(5),
PROSE Assembly Language at prose.sourceforge.net.
Copyright (c) 2002-2009 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_cmp (5) | 23 October 2009 |