0

I have an object of which I would like to view all the properties, but using probe prints out pages and pages of information which I cannot possibly read, and using mold prints out only the first bit.

>> mold input
== {make object! [
    type: 'face
    offset: 20x20
    size: 400x150
    span: none
    pane: none
    text: "Text"
    color: 25...
mydoghasworms
  • 18,233
  • 11
  • 61
  • 95

2 Answers2

1

I am used to use help on objects as in

>> help system
SYSTEM is an object of value:
   version         tuple!    2.7.8.3.1
   build           date!     1-Jan-2011/16:39:07-8:00
   product         word!     View
   core            tuple!    2.7.8
   components      block!    length: 60
   words           object!   [unset! error! datatype! context! native! action! ...
   license         string!   {REBOL End User License Agreement IMPORTANT. READ ...
   options         object!   [home script path boot args do-arg link-url server...
   user            object!   [name email home words]
   script          object!   [title header parent path args words]
   console         object!   [history keys prompt result escape busy tab-size b...
   ports           object!   [input output echo system serial wait-list]
   network         object!   [host host-address]
   schemes         object!   [default Finger Whois Daytime SMTP ESMTP POP IMAP ...
   error           object!   [throw note syntax script math access command resv...
   standard        object!   [script port port-flags email face sound error por...
   view            object!   [screen-face focal-face caret highlight-start high...
   stats           native!   System statistics. Default is to return total memo...
   locale          object!   [months days]
   user-license    object!   [name email id message]

And instead of first on objects you should now use words-of

>> help words-of
USAGE:
    WORDS-OF value

DESCRIPTION:
     Returns a copy of the words of a function or object.
     WORDS-OF is a function value.

ARGUMENTS:
     value -- (Type: any)
>> probe words-of system
== [version build product core components words license options user script console ports network schemes error standard view
   stats locale user-license]
sqlab
  • 6,412
  • 1
  • 14
  • 29
0

You can get all the properties of an object using first, which operates on a large number of types, including objects. When passing an object, it returns a list of words representing the properties.

>> ? first
USAGE:
    FIRST series

DESCRIPTION:
     Returns the first value of a series.
     FIRST is an action value.

ARGUMENTS:
     series -- (Type: series pair event money date object port time tuple any-function library struct event)

So in my example, first input gives the following:

>> probe first input
[self type offset size span pane text color image effect data edge font para feel saved-area rate show? options
parent-face old-offset old-size line-list changes face-flags action state access style alt-action facets related
 words colors texts images file var keycode reset styles init multi blinker pane-size dirty? help user-data flag
s doc]
mydoghasworms
  • 18,233
  • 11
  • 61
  • 95