Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Switch!

From: al:bri:xtra at: 19-Nov-2000 20:01

Sharriff wrote:
> If the block "titles" is not too big (30-40 entries) the snippet runs
fine, but the actual list generates more than 180 entries, the script runs but I get this error:
> ** Script Error: Out of range or past end. > ** Where: switch second :x [ > > Can someone tell me what is wrong?
There's something wrong with your big block pointed to by 'titles. Perhaps one of the titles only has one letter in it? After all, this statement: second :x uses the "second" letter of the strings, rather than the first. It should really be: first x You also don't need the ":" on 'x as it looks like you're switching on strings only. You've got some extra space in your strings, so 'trim it off. Like: first trim x But that's in the wrong place. The code that generates the block should have trimmed it off in the first place and done it's job correctly.
> #"z" []]]
Plus, there's an awfully lot of space in the above line! Wouldn't just one tab or four spaces do? Also, why use 'x and 'y as names? Why not 'heading and 'file? Or something else more descriptive? I hope that helps! Andrew Martin Being right for a change... ICQ: 26227169 -><-