/* findreplace.aml /* /* Called by: findreplace.menu /* Calls made: none /* /* Description: Selects all annotation and replaces find string with replace /* string. /* Set up loop &do &until [show number select] = 0 /* Select all annotation containing find string SELECT $text CN [quote %.ae$findstring%] &if [show number select] > 0 &then &do /* Select first word from selection &s word [unquote [show [show editfeature] [show select 1] text]] /* Reselect only annotation equal to selected first word RESELECT $text = [quote %word%] /* Extract any strings before or after find string from annotation &s before [before [quote %word%] [quote %.ae$findstring%]] &s after [after [quote %word%] [quote %.ae$findstring%]] /* Calculate new $text for annotation &if [null %before%] &then &do &if not [null %after%] &then CALCULATE $text = [quote [unquote %.ae$replacestring%%after%]] &else CALCULATE $text = [quote %.ae$replacestring%] &end /* then do &else &do &if not [null %after%] &then CALCULATE $text = [quote [unquote %before%%.ae$replacestring%%after%]] &else CALCULATE $text = [quote [unquote %before%%.ae$replacestring%]] &end /* else do &end /* then do &end /* do until /* Clear strings &s .ae$findstring &s .ae$replacestring &return