Previous Next

ToString( ) method
Returns information from the specified ABL or .NET class instance, depending on the object type.
Return type:
Access:
Applies to:
Progress.Lang.Object class, System.Object class (from the .NET Framework)
 
Syntax 
ToString( )
This method is also defined on the .NET root class, System.Object, which overrides the method inherited in the ABL class structure from Progress.Lang.Object.
On an ABL class, or on an ABL-derived .NET class instance that does not override ToString( ), this method returns the fully-qualified class or interface type name of the object followed by a unique object identifier, separated by an underscore. You typically override this method in a user-defined class to provide additional contextual information.
On a pure .NET class, the information returned depends on the class type. Also, for any System.Object that boxes a .NET mapped data type (such as a System.Int32), the method returns a character string that represents the value of the mapped data type instance. (For more information on .NET mapped data types, see the Data types reference entry.) For all other .NET types, the information returned depends on how the .NET type overrides the ToString( ) method. For example, on a .NET generic type instance, the method returns a string with the following syntax:
 
Syntax 
namespace.object-nameinteger[type-name[, type-name]...]
Where, namespace is the .NET namespace, object-name is the .NET generic class or interface name up to the left angle bracket (<) of the generic type name, integer after the backquote () is the number of type parameters in the generic type, and type-name is the .NET type name substituted for each type parameter in the constructed type. For more information on .NET constructed type names for generic types, see the Data types reference entry.
So, invoking the method on an instance of the following .NET generic type:
 
"System.Collection.Generic.List<CHARACTER>"
Returns the following string:
 
System.Collections.Generic.List`1[System.String]
Note:

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.