Re: A Puzzle in Eu -- what would you do?

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

Bernie Ryan wrote:
> 
> 
> sequence ctr ctr = {1}
> 
> while 1 do
>  ctr &= match("--",line)
>  if ctr[&] = 0 then exit endif
> end while
> 
> ctr now equals a list of all the locations of the "--" in the line.
> so from there you can figure out where the real comment is.
> 
> 
> Bernie
> 
> My files in archive:
> w32engin.ew mixedlib.e eu_engin.e win32eru.exw
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>
> 

Bernie,

Wow, zen programming.  But my brain has just melted a bit and I don't
understand.  Why start with {1}?  Why not jump forward with each new match? 
Like:
ctr=1
while ctr<=length(line)-length("--") do
  if match("--",line[ctr..$]
matched&=
  ctr=
And what is ctr[&]?

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

Search



Quick Links

User menu

Not signed in.

Misc Menu