Dick Kriesel wrote:
Here's a way:
on mouseUp
put removeBlockComments(the script of me)
end mouseUp
/* this is a comment
as is this */function removeBlockComments pText
put pText into tText
put offset("/*",tText) into tOffset
if tOffset > 0 then
delete char tOffset to tOffset + offset("*/",tText,tOffset) + 1 of tText
put removeBlockComments(tText) into tText
end if
return tText
end removeBlockComments
You should try that script on itself :-)
The "/*" in the first 'offset' line, and the "*/" in the second 'offset'
line are (incorrectly) recognized as a block comment, with fairly
disastrous results. I suspect that proper recognition of block comments
isn't as easy as it might seem - need to handle all forms of string
delimiter, which themselves may be inside comments.
--
Alex Tweedly http://www.tweedly.net
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.2.5/284 - Release Date: 17/03/2006
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution