Click here to Skip to main content
15,915,501 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MDIFrame Pin
30-Apr-02 7:14
suss30-Apr-02 7:14 
GeneralRe: MDIFrame Pin
Tom Archer30-Apr-02 7:33
Tom Archer30-Apr-02 7:33 
QuestionHow do i use a Resource for my main window? Pin
30-Apr-02 6:36
suss30-Apr-02 6:36 
Questionis this wright? Pin
30-Apr-02 6:31
suss30-Apr-02 6:31 
AnswerRe: is this wright? Pin
Tim Smith30-Apr-02 6:37
Tim Smith30-Apr-02 6:37 
AnswerRe: is this wright? Pin
30-Apr-02 6:43
suss30-Apr-02 6:43 
GeneralRe: is this wright? Pin
Ravi Bhavnani30-Apr-02 9:04
professionalRavi Bhavnani30-Apr-02 9:04 
AnswerRe: is this wright? Pin
Philippe Mori30-Apr-02 13:11
Philippe Mori30-Apr-02 13:11 
No, 'a' || 'A' does not mean case 'a' or case 'A' as you intent but case (conditon1 || condition2). Since at least one condition is non-zero, the result of the logical operation is true which is then converted to 1...

So your code in interpreted as:

Forum Visual C++
Subject: Re: is this wright?
Sender: Anonymous
Date: 12:31 30 Apr '02

hi,
i keep getting an error saying ": error C2196: case value '1' already used".
is there another way of having an or function in the middle

<br />
switch (get_textletter)<br />
{<br />
case 1: <br />
   get_textletter=0;<br />
   break;<br />
<br />
case 1: <br />
   get_textletter=1;<br />
   break;<br />
...<br />



and the compiler display an error because the same case appears more than once which is illegal.

What you want to do is to repeat the case statement like this:

<br />
switch (get_textletter)<br />
{<br />
case 'a':<br />
case 'A':<br />
   get_textletter=0;<br />
   break;<br />
<br />
case 'b':<br />
case 'B': <br />
   get_textletter=1;<br />
   break;<br />
...<br />


In any other case, if there are no break between 2 cases, a comment should be added to show that it was your intent and you not forget it. In case like this one, this is clear that you want to continue with the next case because every case appears unindented and one after the other (without any blank line)...



Philippe Mori
QuestionAm I reaching a limit? Pin
lucy30-Apr-02 6:13
lucy30-Apr-02 6:13 
AnswerRe: Am I reaching a limit? Pin
TBK30-Apr-02 6:45
TBK30-Apr-02 6:45 
GeneralRe: Am I reaching a limit? Pin
lucy30-Apr-02 7:02
lucy30-Apr-02 7:02 
GeneralRe: Am I reaching a limit? Pin
Tim Smith30-Apr-02 7:08
Tim Smith30-Apr-02 7:08 
GeneralRe: Am I reaching a limit? Pin
lucy30-Apr-02 8:21
lucy30-Apr-02 8:21 
GeneralCreateProcess - file privileges Pin
30-Apr-02 5:54
suss30-Apr-02 5:54 
GeneralRe: CreateProcess - file privileges Pin
Phil.Benson30-Apr-02 8:19
professionalPhil.Benson30-Apr-02 8:19 
GeneralRe: CreateProcess - file privileges Pin
Ram Cronus1-May-02 0:22
Ram Cronus1-May-02 0:22 
GeneralRe: CreateProcess - file privileges Pin
Phil.Benson1-May-02 21:51
professionalPhil.Benson1-May-02 21:51 
GeneralRe: CreateProcess - file privileges Pin
Ram Cronus2-May-02 4:34
Ram Cronus2-May-02 4:34 
GeneralConvert int to CString Pin
30-Apr-02 5:24
suss30-Apr-02 5:24 
GeneralRe: Convert int to CString Pin
Mike Zinni30-Apr-02 5:31
Mike Zinni30-Apr-02 5:31 
GeneralGet Integer Value from database Pin
30-Apr-02 5:52
suss30-Apr-02 5:52 
GeneralRe: Get Integer Value from database Pin
Nish Nishant30-Apr-02 6:03
sitebuilderNish Nishant30-Apr-02 6:03 
GeneralRe: Get Integer Value from database Pin
Alexandru Savescu30-Apr-02 6:29
Alexandru Savescu30-Apr-02 6:29 
GeneralRe: Get Integer Value from database Pin
Tom Archer30-Apr-02 7:43
Tom Archer30-Apr-02 7:43 
GeneralRe: Convert int to CString Pin
1-May-02 20:10
suss1-May-02 20:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.