🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #8111

Re: Simple CASE statement

#8111
From: rwinslow
Date: Wed, 18 Apr 2001 22:31
80 lines
4075 bytes
Thanks Roedy, Jon, Dale and Dave.

Roedy, this will achieve what is needed, I had my thoughts stuck on the case
way and was been to blind to consider anything else. Thanks. I have added
your web page to my favourites and will go through some of the essays later
when I will be more capable of understanding them.

Jon, thanks for the link to google, checked it out and also your homepage.
Would have liked to suffered the same as the bloke on the right on page 105
tonight but alas am playing in java.

Dale, will follow through and register on the site to see what all the
voting stuff is about.

Dave, another way around my problem, not as elegant as Roedys but will allow
me to use a case statement in the main structure calling a method before the
case.

Thanks again all for the help and advice.

Richard Winslow,
rwinslow@hotmail.com



"Dale King" <KingD@TCE.com> wrote in message news:3addf366@news.tce.com...
> "Jon Skeet" <skeet@pobox.com> wrote in message
> news:MPG.1547f326d1c2a78998a2ed@mrmog.peramon.com...
> > rwinslow <rwinslow@hotmail.com> wrote:
> > > Have also sent to borland.public.jbuilder.java.language so apologies
to
> > > those who read both groups.
> > >
> > > I am having problems with a case statement, I am sure that I have seen
> code
> > > with what I need in but have had no success looking through several
> > > reference books or the JBuilder help.
> > >
> > > This I can do already, in another part of the code (a simple library
> system
> > > accessed through the console)
> > >       switch (aChar)
> > >       {
> > >         case 'A' :
> > >           hanAdd();  break;
> > >         case 'P' :
> > >           hanPrint();  break;
> > >         case 'Q' :
> > >           hanQuit();  break;
> > >         case 'F' :
> > >           hanFind();  break;
> > >
> > >         default :
> > >           break;
> > >       }
> > > What I want to do in another part is to check that the char at a place
> in a
> > > String is either a number, a lower case letter or a capitol letter. I
> think
> > > it is along the lines of 'case "a..z" ' but have been unable to
compile
> > > using single/double quotes in several combinations like 'a' .. 'z' and
> all
> > > the others I can think of.
> > >
> > > If you know the format please pass your knowledge to me.
> >
> > You can't do that - switch/case just doesn't work that way. Search on
> > groups.google.com for a long thread in comp.lang.java.programmer on
> > suggested changes of syntax.
>
> And if you're interested in getting that capability added to the language,
> vote for thise RFE:
> http://developer.java.sun.com/developer/bugParade/bugs/4269827.html
>
> --
>   Dale King
>
>
>
Technical Details
Message-ID: <szoD6.3991$a46.277503@news2-win.server.ntlworld.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!194.176.220.130!newsfeed.icl.net!dispose.news.demon.net!demon!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news2-win.server.ntlworld.com.POSTED!not-for-mail
References: <SXkD6.2227$a46.165151@news2-win.server.ntlworld.com> <MPG.1547f326d1c2a78998a2ed@mrmog.peramon.com> <3addf366@news.tce.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113ae9,d11749ba8c97f8b1
X-Google-Attributes: gid113ae9,public
X-Google-Thread: f74b3,31809f34af9f5ab7,start
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-04-18 15:42:16 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!194.176.220.130!newsfeed.icl.net!dispose.news.demon.net!demon!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news2-win.server.ntlworld.com.POSTED!not-for-mail
From: "rwinslow" <rwinslow@hotmail.com>
Newsgroups: borland.public.jbuilder.java.language,comp.lang.java.help
References: <SXkD6.2227$a46.165151@news2-win.server.ntlworld.com> <MPG.1547f326d1c2a78998a2ed@mrmog.peramon.com> <3addf366@news.tce.com>
Subject: Re: Simple CASE statement
Lines: 82
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2462.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
Message-ID: <szoD6.3991$a46.277503@news2-win.server.ntlworld.com>
Date: Wed, 18 Apr 2001 23:31:34 +0100
NNTP-Posting-Host: 213.105.85.116
X-Complaints-To: abuse@ntlworld.com
X-Trace: news2-win.server.ntlworld.com 987632984 213.105.85.116 (Wed, 18 Apr 2001 23:29:44 BST)
NNTP-Posting-Date: Wed, 18 Apr 2001 23:29:44 BST
Organization: ntl Cablemodem News Service