ReplaceAll
protoTXView:ReplaceAll(str, startOffset, options, data)
Searches the text in the view, starting at the specified offset, and replaces all occurrences of a string with other data.
- str
- The string to be replaced
- startOffset
- The starting offset of the search in the text, specified as a number of characters.
- options
- Must be
nil
.
- data
- A frame describing the new data. This can be a graphics specification frame, as described in "The Graphics Specification Frame". Or data can be a frame with the following slots:
text
If this slot isnil
, style runs are replaced, but the text remains the same. If non-nil
, this is the new text.
styles
If this slot isnil
, the new text uses the style attributes at the start of the range. If non-nil
, this is an array with two entries for each style run in the range. The first entry specifies the number of characters, and the second is either a font specification frame or a graphics specification frame. The run length is always 1 for graphics specification objects. For a description of the font specification frame, see the section "Font Frame" (8-18) in Newton Programmer's Guide. See "The Graphics Specification Frame" for a description of the graphics specification frame.
- return value
- The number of replacements made by *
ReplaceAll
.
- WARNING
- This operation can not be undone.
![]()
Storage Methods
This section describes the methods that you can use to save and retrieve word-processing documents. What you normally do with these documents is to put the *protoTXView
data frame in a soup entry slot and then use the standard soup methods to store or modify it.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help