UserLand Software Home  |  Manila  |  Radio  |  Support  |  News

DocServer

Prev | Next | Basic Verbs > edit

edit

Syntax 

edit (address, windowTitle = nil, flReadOnly = false, adrButtonTable = nil)

Params 

address is an address value that points to the object in the database that you wish to edit.

windowTitle is an optional parameter, a string.

flReadOnly is an optional parameter, a boolean.

adrButtonTable is an optional parameter, the address of a table containing scripts which run when outliner buttons are clicked.

Action 

Opens the object at address in an appropriate type of window and prepares for the user to edit the object, if the parameter is a valid object database address.

For scalar objects (such as strings) for which no special editing window exists, Frontier selects the object in its parent's table and makes it available for editing.

If windowTitle is not nil, and the object is not a scalar, then, before opening the window for viewing, its title is changed to the indicated title.

If adrButtonTable is not nil, and the object to edit is an outline, then the window will contain one button for each script in the table referenced by adrButtonTable. The name of the button is the name of the script. The script is run when the button is clicked.

Returns 

The address of the previous target window.

Examples 

edit (@examples.testOutline)

edit (@examples.testOutline, "This is just a test...")

edit (@examples.name) //it's a string, a scalar

new (tableType, @scratchpad.userInfo);
scratchpad.userInfo.created = clock.now ();
edit (@scratchpad.userInfo, "User Info")

edit (@examples.testOutline, flReadOnly:true) //open as read-only

local (adrButtonTable = @temp.buttons); //a table for the outliner buttons
new (tableType, adrButtonTable);
script.newScriptObject ("msg (\"Hello!\")", @adrButtonTable^.Hello);
script.newScriptObject ("msg (\"Flowers are pretty\")", @adrButtonTable^.Flowers);
script.newScriptObject ("msg (\"Math is hard.\")", @adrButtonTable^.Math);
edit (@workspace.notepad, adrButtonTable:adrButtonTable)

Errors 

Supplying a value for address which Frontier cannot coerce into a valid address form produces an error.

If flReadOnly is true, and address references a wp-text object, then a scriptError is generated.

If adrButtonTable is not nil, and address references an object which is not an outline, an error is generated.

Notes 

This verb is implemented as a script.

The windowTitle parameter was added 10/9/98 by DW.

The flReadOnly parameter was added to Frontier 7.

The adrButtonTable parameter was added to Frontier 8.

See also 

target.set

close

window.setTitle

window.open

Frontier: Outliner Buttons

Prev | Next | Basic Verbs > edit

Anonymization by Anonymouse.org ~ Adverts
Anonymouse better ad-free, faster and with encryption?
X