From: Lloyd Zusman Date: 2005-03-03T09:58:25+09:00 Subject: Re: Erb: terminating a script? Jim Weirich writes: > On Wednesday 02 March 2005 07:32 am, Lloyd Zusman wrote: >> I want to do something similar in Erb: >> >> A
>> B
>> <% WHAT GOES HERE TO END THE SCRIPT? %> >> C
>> D
>> >> What do use for "WHAT GOES HERE ..." in order to cause the >> processing to end after A and B print out? > > Here's a bizzare idea ... > > <% callcc do |quit_early| %> > A
> B
> <% quit_early.call %> > C
> D
> <% end %> > > Does that work? Yes, it does work. I still like the lambda-call thing I mentioned in my previous message, because using 'break' and 'return' seem to me to be more natural to use. But this is a good idea, also. Thanks. -- Lloyd Zusman ljz@asfast.com God bless you.