www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/07/15:19:36

From: "Jeffrey Drake" <jdrake AT lonet DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Check a range of numbers with case
Date: 6 May 1997 02:29:52 GMT
Organization: iSTAR internet Incorporated
Lines: 54
Message-ID: <5km530$6kv@nr1.toronto.istar.net>
References: <0000jjzjjbzl DOT 0000iswkaeyu AT dca DOT gov DOT au>
NNTP-Posting-Host: news.lonet.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

This is a multi-part message in MIME format.

------=_NextPart_000_01BC59A3.973B04A0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

DBerry1 AT dca DOT gov DOT au wrote in article
<0000jjzjjbzl DOT 0000iswkaeyu AT dca DOT gov DOT au>...
> 
> I've slowly been working my way through learning C and DJGPP, and I was 
> wondering if it's possible to use a Case statement to check for a range
of 
> numbers - not just one....
> 
> eg..
> 
> Switch (bullet_x)
> 
>   Case (alien1_x to alien1_x + 16)
> 	then alien_hit = 1
>   Case (alien2_x to alien2_x + 16)
> 	then alien_hit = 2
>   Default
> 	alien_hit = 0
What language is this? C has semicolons, braces. Not then???
>

-- 

Jeffrey Drake
jdrake AT lonet DOT ca
www.lonet.ca/res/jdrake/homepage.html
------=_NextPart_000_01BC59A3.973B04A0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html><head></head><BODY bgcolor=3D"#FFFFFF"><p><font size=3D2 =
color=3D"#0000FF" face=3D"Arial"><u>DBerry1 AT dca DOT gov DOT au</u><font =
color=3D"#000000"> wrote in article &lt;<font =
color=3D"#0000FF"><u>0000jjzjjbzl DOT 0000iswkaeyu AT dca DOT gov DOT au</u><font =
color=3D"#000000">&gt;...<br>&gt; <br>&gt; I've slowly been working my =
way through learning C and DJGPP, and I was <br>&gt; wondering if it's =
possible to use a Case statement to check for a range of <br>&gt; =
numbers - not just one....<br>&gt; <br>&gt; eg..<br>&gt; <br>&gt; Switch =
(bullet_x)<br>&gt; <br>&gt; &nbsp;&nbsp;Case (alien1_x to alien1_x + =
16)<br>&gt; &#009;then alien_hit =3D 1<br>&gt; &nbsp;&nbsp;Case =
(alien2_x to alien2_x + 16)<br>&gt; &#009;then alien_hit =3D 2<br>&gt; =
&nbsp;&nbsp;Default<br>&gt; &#009;alien_hit =3D 0<br>What language is =
this? C has semicolons, braces. Not then???<br>&gt;<br><br>-- =
<br><br>Jeffrey =
Drake<br>jdrake AT lonet DOT ca<br>www.lonet.ca/res/jdrake/homepage.html</p>
</font></font></font></font></body></html>
------=_NextPart_000_01BC59A3.973B04A0--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019