Part of the Samples Website. 8/16/97.


«Builds an outline of any table in the object database
on buildTableOutline (tableAdr, outlineAdr)
new (outlineType, outlineAdr)
target.set (outlineAdr)
op.setLineText ("Outline of " + tableAdr + " table")
local (dir = right) «first headline inserted to the right
on traverse (adr)
local (adrsubitem, i)
for i = 1 to sizeof (adr^)
adrsubitem = @adr^ [i]
op.insert (nameOf (adrsubitem^), dir)
if typeOf (adrsubitem^) == tableType
dir = right
traverse (adrsubitem) «recurse
if dir [not equal] right «at least one item added from the table
op.go (left, 1)
dir = down
rollBeachBall ()
traverse (tableAdr)
op.firstSummit ()
window.zoom (outlineAdr)
return (true)
bundle «test code
local (tableAdr = table.getCursor ())
if typeof (tableAdr^) != tableType
tableAdr = toys.getParentTable (tableAdr)
local (outlineAdr = @scratchpad.tableOutline)
buildTableOutline (tableAdr, outlineAdr)
edit (outlineAdr)

This page was last built on Sat, Aug 16, 1997 at 6:33:37 PM. You can download the current set of sample scripts from our FTP site. Dave