Re: find if any memers of a set are in another set (blank line fi nder)?

new topic     » topic index » view thread      » older message » newer message

Sorry guys, I'm re posting this 52 minutes after I last sent it since 
the one I posted 20 mins ago has long ago shown up. 
 
 
On Fri, 19 Jul 2002 04:49:09 -0700, Dan Moyer 
<DANIELMOYER at prodigy.net> wrote: 
 
>======== The Euphoria Mailing List ========  
> 
>Derek, 
> 
>Ok, enough people have said "check each for non white-space" is faster, so 
<snip> 
My thought is this: 
space=#32 
tab=#09 
cr=#13 
lf#10 
 
What, if any, cases exist where a byte <32 is *not* whitespace. 
What, if any, cases exist where a byte >32 is *not* text? 
 
Hence, replace 
>>         if find(x[i][k], " \n\t\r") = 0 then 
with 
	   if x[i]>32 then --- not blank 
 
Don't take my word for it, test this out on your data. 
Some foreign characters may fail this simple test. 
In which case: 
	zx[i] 
	if z<0 or z>32 then -- would be my next best bet. 
 
(and yes, I have not tested it, but I would put money on it being 
faster than if x[i]<0 or x[i]>32 ) 
 
 
2nd: re tab: 
 
If your or my code reads: 
 
a="12345678" 
b"        " 
c="        " 
<use/imagine a non-proportional font where the "s all align> 
 
then the *compiler* will read b={space#32}*8, and c=#09 alone. 
 
You & I might stare in disbelief that b is *NOT*  c 
 
As a text editor will show the same results when you or I hit the 
space bar eight times or the tab key once, I think it is absolutely 
correct that the compiler screams "I cannot *KNOW* what you mean" 
 
IE use \t between quotes rather than the tab key. 
 
Pete

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu