Arbortext Command Language > Hooks > editbeforehook
  
editbeforehook
editbeforehook
 
Function prototype:
hook (name)
Synopsis
Use with:
add_hook(hookname, func[, prepend])
remove_hook(hookname, func)
where hookname is editbeforehook.
This hook is called before the document or file specified by name is opened. If this function returns -1, the switch to a new document is canceled.
For the revert case (edit -current), editbeforehook is passed the path name of the document being reverted. The hook detects this case by comparing name to the current document's path name, doc_path(0).
editbeforehook is called twice if the edit command is used without a path name (that is, to bring up the Open Document dialog box). editbeforehook is called with name equal to the null string before the dialog box appears, and then (if the first call does not return -1 to abort the operation) called a second time with the path name selected from the dialog box.
Argument
name is the name of the document or file being opened.