comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier <gautier.demontmollin@maths.unine.ch>
Subject: Re: Case Sensitivity
Date: 2000/05/11
Date: 2000-05-11T00:00:00+00:00	[thread overview]
Message-ID: <391AD652.BF1B28D7@maths.unine.ch> (raw)
In-Reply-To: 958056490.47876@hearts.q-net.net.au

Cameron McShane:

> If the user is to be allowed to enter Buy or BUY or bUy - etc, do I need to
> make the data type

>     type Menu_Options is (buy, Buy, bUY, etc

Wow: 2^n cases for one option worded with n letters! BTW, try it:
you might discover that Ada -fortunately- is case insensitive...

> or is there a way of converting user input to all lower case?

Yes! Check for a To_Lower function in some Ada.* package.

BTW, the To_Upper will be more useful to compare with "BUY" "READ"
"DONE" returned by the function Menu_Options'Image( option ).

Or better: Menu_Options'Value( a_string ) will return a value
of Menu_Options type, and is case already insensitive :-) !

HTH
______________________________________________________
Gautier  --  http://members.xoom.com/gdemont/gsoft.htm




  parent reply	other threads:[~2000-05-11  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-11  0:00 Case Sensitivity Cameron McShane
2000-05-11  0:00 ` Alfred Hilscher
2000-05-11  0:00 ` Ted Dennison
2000-05-11  0:00 ` Florian Weimer
2000-05-11  0:00 ` Gautier [this message]
2000-05-12  0:00 ` John English
2000-05-12  0:00   ` David C. Hoos, Sr.
2000-05-15  0:00     ` John English
  -- strict thread matches above, loose matches on Subject: below --
1993-07-04  9:12 case sensitivity Erik Magnuson
1993-07-02 15:53 Robert I. Eachus
1993-07-01 23:03 cis.ohio-state.edu!pacific.mps.ohio-state.edu!math.ohio-state.edu!darwin.
1989-02-20 19:45 pse_papay
1989-02-21  8:18 ` Bruce Anderson
1989-02-22 22:28 ` Steven D. Litvintchouk
1989-02-27 14:45 ` Dennis M. O'Connor
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox