Solved

100+ errors

Posted on 1998-09-05
3
183 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
Comment Utility
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
Comment Utility
If you have any questions, please feel free to ask!
0
 

Author Comment

by:bobshoe
Comment Utility
Thanks! I knew it would be simple!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

772 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

11 Experts available now in Live!

Get 1:1 Help Now