table.visit

Syntax table.visit (addr, visitproc)

Params addr is the Object Database address of a table.

visitproc is the name of a verb or script to be invoked for the table and every valid address subordinate to it.

Action Visit every cell in the table indicated by addr, at all levels, executing visitproc at each entry.

Returns The results of visitproc's last execution. If visitproc returns false, this verb returns false and processing is terminated.

Examples table.visit (@examples, @msg)

   » true

Displays the names of everything in the examples table.

Examine this script:
edit (@examples.countTables)

table.visit (@examples, @countTables)

This calls the Frontier table.visit verb and tells it to apply the processing contained in the local script "countTables" to every entry in the table called "examples." It displays the number of tables it finds in the Main Window.

Notes visitproc must take a single parameter that can be coerced from an address type and it must return a boolean result.

visitproc will be called once with the address of the table itself before it is called with any subordinate addresses.

Discuss