Implemented for Internal, External and System classes.
Syntax:
old „ objref.ŒDF string
old „ ŒDF string (Within user-defined method, same as ŒTHIS.ŒDF string)
Normally, when you display a variable or temporary result which contains an object reference, APLX displays the reference in a standard form (the class name enclosed in square brackets). The monadic system method ŒDF allows you to substitute your own string to replace this. The right argument should be a character vector (it will be truncated on display if it is longer than 40 characters). If the right argument is an empty vector, the default display format is restored.
The explicit result of ŒDF is the previous value.
For example, if you have a user-defined class called Queue:
Q„ŒNEW 'Queue' Q [Queue] Q.ŒDF 'Box Office Queue' Q Box Office Queue Q.ŒDF '' © Restore default format Box Office Queue Q [Queue]
ŒDF may be used within a Constructor, to set the default display of an object depending on the values used to create it.
You can use ŒDF to set the default display form of any object, including External and System objects:
W„'Œ' ŒNEW 'Window' W [Œ:Window] W.ŒDF 'Main window' W Main window 2 3½W,¼5 Main window 1 2 3 4 5
The display string which you set using ŒDF applies to monadic format as well as display of expressions. See also ŒDS which returns a text form of an object.