HyperCard: Search & Replace Handler (7/92)

The replacePrompt handler searches for text, asks for permission, then
replaces it with a new string if you let it.

on replacePrompt old,new
repeat
send "find string" & quote & old & quote to HyperCard -- no overriding
if the result is not empty then exit replacePrompt -- done
answer "Replace this one?" with "No" or "Yes"
if it is "No" then next repeat
do "put new into " & the foundChunk
end repeat
end replacePrompt


This article is adapted from the Claris Tech Info database.
Published Date: Feb 19, 2012