Solved

100+ errors

Posted on 1998-09-05
3
184 Views
Last Modified: 2010-04-02
Hi all experts,

I am having problems with some code.  When it is compiled, it gives me over 100 errors (102 to be exact, after that point it says the compiler has exceeded the maximum limit).

I have been laboring over it for over an hour.  In the past, whenever this has happened, it was something simple.

Here is the code:
DWORD numwords = 0;
  CWaitCursor cur;

  UpdateData (TRUE);

  m_Results = "";

  switch (m_SearchType)
  { case (0): // Ascii
             numwords = m_Dict->SearchAscii (m_Results, m_Search1);
             break;

    case (1): // alphabet, a = 1, b = 2 etc
              numwords = m_Dict->SearchAlpha (m_Results, m_Search1);
              break;

    case (2): // Anagrams, i.e. cat = act
              numwords = m_Dict->SearchAnagrams (m_Results, m_Search2);
              break;

    case (3): // Palindromes, i.e. madam
              numwords = m_Dict->SearchPalindromes (m_Results, m_Search1);
              break;

    case (4): // Regular
              numwords = m_Dict->SearchRegular (m_Results, m_Search2);
              break;

    case (5): // Duplicates
              numwords = m_Dict->SearchDuplicates (m_Results, m_Search1);
              break;

    case (6): // Percentage thare are at least x percent vowels
              numwords = m_Dict->SearchPercentage (m_Results, "aeiouy", m_Search1);
              break;

    case (7): // Percentage thare are at least x percent consonant
              numwords = m_Dict->SearchPercentage (m_Results, "bcdfghjklmnpqrstvwxz", m_Search1);
              break;

    case (8): // Custom percentage.
              numwords = m_Dict->SearchPercentage (m_Results, (char *) m_Search2.operator LPCTSTR (), m_Search1);
              break;

    case (9): // Words that contain certain letters.
              numwords = m_Dict->SearchLetters (m_Results, (char *) m_Search2.operator LPCTSTR ());
              break;

    default: ASSERT (0);
  }

  if (numwords != 0)
  [ CString temp;
    temp.Format ("\r\n# words: %d", numwords);
    m_Results += temp;
  }

  UpdateData (FALSE);

Thanks!
0
Comment
Question by:bobshoe
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
thresher_shark earned 150 total points
ID: 1172075
Hmm... You seem to have a bracket where an opening "swirly brace" should be, i.e. one of these:   {

Change this


if (numwords != 0)
[ CString temp;
  temp.Format ("\r\n# words: %d", numwords);

to:


if (numwords != 0)
{ CString temp;
  temp.Format ("\r\n# words: %d", numwords);

That ought to fix it.
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1172076
If you have any questions, please feel free to ask!
0
 

Author Comment

by:bobshoe
ID: 1172077
Thanks! I knew it would be simple!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now