FindChange
viewDef:FindChange(action, data)
Called when the user performs a Find operation from Newton Works Find/Change slip.
DISCUSSION
- action
- A symbol indicating the action the user requested:
'find
,'change
, or'changeAll
.
- data
- Varies depending on the value of action. See Table 1-1 for details.
- return value
- Varies depending on the value of action. See Table 1-1 for details.
Table 1-1 explains what you should do in this method, the value of the data parameter, and what you should return. This method also is responsible for updating the view appropriately. For example, if action is
'find
, you must scroll to the first found item and highlight it.Table 1-1 FindChange parameters and actions
action value data value FindChange method should do this 'find
A string to find. Search for the next string that matches, starting from the current selection. The search should wrap if necessary. Return true
if the string is found,nil
if not.'change
A frame with slots findStr
(string to find) andchangeStr
(string to replace with).Replace the current selection with changeStr
. IffindStr
does not match the current selection, this is an error condition. Returntrue
if the selection is replaced withchangeStr
,nil
if not.'changeAll
A frame with slots findStr
(string to find) andchangeStr
(string to replace with).Replace all instances of findStr
withchangeStr
. Return the number of instances replaced, as an integer.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help