Printing
GetRoot()
with no limit on the printing! Fortunately, there is a mechanism for controlling the depth of this recursive printing.
FIGURE 8.4 : The printDepth
popup in the Inspector window.
printDepth
global variable contains an integer that sets the depth of recursive printing. The higher the number, the more levels that print. The default value for this variable is 1. You can set this variable directly from the Inspector, or by using the printDepth popup (see FIGURE 8.4). The following frame serves as a good test for showing these different levels:
f := { name: "Neil", height: 73.25, children: [ { name: "Nicholas", height: 48, children: [], }, { name: "Alexander", height: 43, children: [], }, { name: "Nathaniel", height: 24, children: [], }, ] }Using print depths from -1 to 2, TABLE 8.2 shows that each change yields one more level of detail. It would take a print depth of 3 in order to see the full contents of the example frame.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996