I am using this handler to search and replace (I answered my own previous
post about the replace after studying the wonderful class on text files at
the XWorlds "MetaClass" site.)

on mouseUp
  global jai, hrim
  answer file "Select A Text File"
  put it into tPath
  put url ("file:"&tPath) into theFileData
  
  replace jai with hrim in theFileData
  put theFileData into url ("file:"&tPath)
end mouseUp 

This is awesomely fast! compared to anything I have ever used to date.
Replacing as many as 14000 instances of a string in a 3 meg text file in the
blink of an eye!--MC is great. . .

But first we prompt the user for the search and replace strings with this
handler:

on mouseUp
  global jai, hrim
  ask "What do you want to replace?" with "OK"
  if it is empty then exit mouseup
  put it into jai
  ask "With what" with "OK"
  if it is empty then exit mouseup
  put it into hrim
  put jai & "|" & hrim & cr after field "replaceList"
             # the intent is to save the strings for future use using a
"pipe" (|) as delimiter
end mouseUp

Two questions: 
1) line:
put jai & "|" & hrim & cr after field "replaceList"

is not working. . .no data appears in the field. . .which is on the same
card. This appears correct to me. . .but doesn't work.

2) how does one enter special characters into an ASK dialogue box?

Specifically I need to replace double returns and some tab & cr
combinations. But I would like to be able for the user just to paste those
in. . .but if you paste a string that has a return in it into the dialogue
box, the return seems to 'disappear." Do I need to use escape sequences?

Thanks.
Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
www.HinduismToday.com
[EMAIL PROTECTED]


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to