Topic: APLX Help : Help on APL language : System Methods : ⎕DF Set display form
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

⎕DF Set display form


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.


Topic: APLX Help : Help on APL language : System Methods : ⎕DF Set display form
[ Previous | Next | Contents | Index | APL Home ]