Mark Smith wrote:

ps. the function I used was:

function isText tData
 --  put replacetext (tData,"[^\x20-\x7E\n\r\t]","") into nData
 --  return tData = nData

 repeat for each char c in tData
   add 1 to tc
   get charToNum(c)
   if it <> 9 OR it <> 10 Or it <> 13 AND it < 32 then exit repeat
 end repeat
 return tc = length(tData)
end isText

Ummmm - that's not right.
Instead of

   if it <> 9 OR it <> 10 Or it <> 13 AND it < 32 then exit repeat

it should be

   if it <> 9 AND it <> 10 AND it <> 13 AND it < 32 then exit repeat


As it is, every character will pass that test - usually on the first and certainly no later than the second sub-clause of the test.

I'd still expect this method to be faster than the Regex - but your test will run somewhat faster than the correct equivalent would.


--
Alex Tweedly       http://www.tweedly.net



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.10/383 - Release Date: 07/07/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

Reply via email to