Solved

100+ errors

Posted on 1998-09-05
3
187 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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.

809 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