First rule: Don't read data into a field.
Basic implementation is to get a list of paths to files that need work in one field called "fileList"
then run scripts against those files like this, where the fld ""sNr" is a series of lines with
[stringToReplace] tab [stringToChangeTo] in each line.
I keep a library of these "arrays" in a substack and pass them to fld "sNr"
writes to a new file, same name with galley # added.
on mouseUp
set the cursor to watch
put ticks() into tStart
put empty into fld "resultList"
answer "This operation will output a new file with " & quote & "2" & quote & cr &\
"appended to the file name. Continue?" with "No" or "Yes"
if it is "No" then exit MouseUp
set the caseSensitive to (the hilite of btn "Case sensitive")
set the itemdel to tab
put fld "sNr" into tChanges
put fld "fileList" into tFileList
repeat for each line y in tFileList
set the itemdel to tab put url ("file:"&y) into tFileData repeat for each line z in tChanges
replace (item 1 of z) with (item 2 of z) in tFileData
end repeat if the hilite of btn "Write New File" then
set the itemdel to "."
put item 1 of y &"-g2" & ".txt" into x
put tFileData into url ("file:"&x)
else
put tFiledata into url ("file:"&y)
end ifend repeat calcTime(tStart) end mouseUp
It's actually incredibly simple.
If you want the stack, let me know off line..it's a bit of a mess but works great.
Sivakatirswami
On Mar 26, 2005, at 1:27 PM, Andre Garzia wrote:
Hi Folks,
I am having some trouble escaping text with international characters for HTML pages. I thought a simple approach, I built a field with all the escapes like:
á á é é Á Á ...
and stuff like that, then I used a repeat loop to loop thru the data replacing the ocurrence of the first char with the corresponding HTML entity, guess what? It does not work, the replace command is not replacing them, it's a big field, it works only for some lines, others are completelly ignored, I used the debugger to iterate thru the code, and guess what, it's all appearing correct just the engine is telling the the "é" inside the field is not the same "é" that it needs to escape... damn. Any clue out there? does anyone here got a HTML escaping routines for international chars?
Andre -- Andre Alves Garzia 2004 BRAZIL http://studio.soapdog.org
_______________________________________________ use-revolution mailing list [email protected] http://lists.runrev.com/mailman/listinfo/use-revolution
_______________________________________________ use-revolution mailing list [email protected] http://lists.runrev.com/mailman/listinfo/use-revolution
