Product Site

5.1.4.25. string

Returns a human-readable string representation of the object. The exact form of this representation depends on the object and might not alone be sufficient to reconstruct the object. All objects must be able to produce a string representation of themselves in this way.

The object's string representation is obtained from the objectName method (which can in turn use the defaultName method).

The distinction between this method, the makeString method (which obtains string values) and the request method is important. All objects have a string method, which returns a string representation (human-readable form) of the object. This form is useful in tracing and debugging. Only those objects that have information with a meaningful string form have a makeString method to return this value. For example, Directory objects have a readable string representation ("a Directory"), but no string value, and, therefore, no makeString method.

Of the classes that Rexx provides, the Array Class, the CircularQueue Class, the DateTime Class, the File Class, the MutableBuffer Class, the StackFrame Class, the String Class, and the TimeSpan Class have a makeString method. Any subclasses of these classes inherit this method by default, so these subclasses also have string values. Any other class can also provide a string value by defining a makeString method.