getObjectStringForObject

getObjectStringForObject(obj: Object): String;

The getObjectStringForObject method of the Object class returns a string representing the object specified in the obj parameter.

This method is the inverse of the String primitive type asObject method.

The returned string consists of the oid-like string based on class numbers, followed by an optional lifetime indication.

The form of the oid-like string can be one of the following.

The optional lifetime can be '(t)', to indicate a transient object, or '(s)', to indicate a shared transient object. If the optional lifetime is absent, it indicates a persistent object.

The code fragments in the following examples show what is returned after each of the assignments to o.

// return persistent instance of class number 16401
o := '16401.1'.asObject;
// return '16401.1' for a persistent instance
write getObjectStringForObject(o);
// return transient instance of class number 16401
o := '16401.1 (t)'.asObject;
// return '16401.1 (t)' for a transient instance
write getObjectStringForObject(o);
// return shared transient instance of class number 16401
o := '16401.1 (s)'.asObject;
// return '16401.1 (s)' for a shared transient instance
write getObjectStringForObject(o);

For details about returning the object id (oid) in a string format for the specified object, see the Object class getOidStringForObject method.