On Thu, 11 Jun 2009, dave wrote:

> Hugh,
> 
> Yes i did see it but it didn't register with me.
> 
> so can i infer that this would be okay?
> when :enter, '\n'    as you had in this (see below)?
> > > > > when :baz, 'baz'

That ought to work from what I know of Ruby syntax, provided keypress
yields those to the block.
> 
> reason why i ask is that the keypress for the enter key above your shift key 
> returns the :enter value and the enter key on the numeric pad give the \n or 
> newline character.
> 
> I had tried :enter, '\n' also :enter, "\n" but the numeric keypad wouldn't 
> respond to the keypress on the numeric pad.
> 
> If you re read my posting i am sure i said i'd tried single & double qutoes 
> about the \n and had tried , and the ; between the two values  eg
> when :enter, '\n'  -  when ęnter;'\n'  - when :enter, "\n"  - when :enter; 
> "\n" all not responding to the numeric pad enter press.

Quickly looking through the postings, I don't see an example of your code
using this case form with those.  The use of semi-colon won't work.
Your earlier code didn't use a block with keypress, your later code used
if statements instead.
> 
> can you confirm that what ie say above works or fails on your system?

I don't have time to write code and test this at the moment, sorry.  

> 
> thanks.

        Hugh
> 
> On Thursday 11 June 2009 09:37:18 pm Hugh Sasse wrote:
> > On Thu, 11 Jun 2009, dave lilley wrote:
> > > @Hugh,
> >
> > Search below for :baz
> >
> > > Now I don't see it as a big issue now as i've got my program
> > > working as i want it to for now (ie i can enter a customer #
> > > or customer name and get a result from SQLite3).
> > >
> > > cheers,
> >
> >         HTH
> >         Hugh
> >
> ****snipped ****
> > > > > case foo
> > > > > when 'bar'
> > > > >   puts 'bar!'
> > > > > when :baz, 'baz'
> > > > >   puts 'baz!
> > > > > when 2000..2009
> > > > >   puts 'the aughts!'
> > > > > when /^regex(\/
> > > > >   puts "matching: #{$1}"
> > > > > else
> > > > >   puts "the naughts!"
> > > > > end
> 
> 
> 
> 

Reply via email to