Implemented for Internal, External and System classes.
Syntax:
string „ objref.ŒDS
string „ classref.ŒDS
string „ ŒDS (Within user-defined method, same as ŒTHIS.ŒDS)
ŒDS returns a character vector containing a summary of an object in human-readable form.
For Internal classes, ŒDS returns a summary of properties of the object, abbreviated if they are longer than around 50 characters. For example, if the class Contact has properties Name, Address, Email, and Recnum, the summary display might be as follows:
A„ŒNEW Contact A.Name„'Alphonse T. Randall' A.Address„'The Manor House,Main Square,Moreton-under-Stockwood,Tenby' A.EMail„'Alphonse.Randall@themanor.com' A.Recnum„34973 A.ŒDS Name='Alphonse T. Randall', Address='The Manor House,Main Square,Moreton-under-S tockwoo...', EMail='Alphonse.Randall@themanor.com', Recnum=34973
For System classes, ŒDS returns the class name.
For External classes, ŒDS is mapped to whichever method in the target architecture is used for the default string form of an object. This is ToString for .Net. to_s for Ruby, toString for Java, and format for R.
In this example, we create (in each of three architectures) an object representing the same date/time, and use ŒDS to display the date/time in human-readable form:
'ruby' ŒSETUP 'require' 'Date' RubyDate„'ruby' ŒNEW 'DateTime' 2004 12 13 8 34 03 RubyDate.ŒDS 2004-12-13T08:34:03+00:00 NetDate„'.net' ŒNEW 'DateTime' 2004 12 13 8 34 03 NetDate.ŒDS 13/12/2004 08:34:03 JavaDate„'java' ŒNEW 'java.util.Date' 2004 12 13 8 34 03 JavaDate.ŒDS Fri Jan 13 08:34:03 GMT 3905 MixedObjects„RubyDate,NetDate,JavaDate MixedObjects [ruby:DateTime] [.net:DateTime] [java:Date] MixedObjects.ŒDS 2004-12-13T08:34:03+00:00 13/12/2004 08:34:03 Fri Jan 13 08:34:03 GMT 3905 ŒDISPLAY MixedObjects.ŒDS Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Û Û2004-12-13T08:34:03+00:00Û Û13/12/2004 08:34:03Û ÛFri Jan 13 08:34:03 GMT 3905Û Û Û ÀÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ ÀÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ ÀÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ Û À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ
The actual string which is displayed depends on the individual class. The style of the display may not always be consistent for a given architecture. For example, in the .Net framework, the ToString method sometimes displays the data associated with the class (as in the DateTime example above), sometimes just the object's class name, and sometimes a verbose summary of an object's properties:
PT„'.net' ŒNEW 'System.Drawing.Point' PT.ŒDS {X=0,Y=0} FD„'.net' ŒNEW 'System.Windows.Forms.FontDialog' FD.ŒDS System.Windows.Forms.FontDialog, Font: [Font: Name=Microsoft Sans Serif, Size=8 .25, Units=3, GdiCharSet=0, GdiVerticalFont=False] HT„'.net' ŒNEW 'System.Collections.Hashtable' HT.ŒDS System.Collections.Hashtable
In this example, in R, we create an array of complex numbers and use ŒDS to format it:
m„'r' Œnew 'complex' (3 2½(1 2) (3 4) (5 6) (7 8) (9 10) (11 12)) m [r:matrix] m.Œds 1+ 2i 3+ 4i 5+ 6i 7+ 8i 9+10i 11+12i