Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6958485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:08:45+00:00 2026-05-27T15:08:45+00:00

first time poster so forgive me if my formatting is off or anything :)

  • 0

first time poster so forgive me if my formatting is off or anything 🙂

I’m working on my game engine in C# using XNA but when I check the name of a new node against existing nodes, the Assert fires off unpredictably even when there is no matching name in the list. Here is the code I’m referring too:

    public void CheckNameIsUnique(string cName)
    {
        for (int i = 0; i < m_aNodeList.Count; ++i)
        {
            Debug.Assert(m_aNodeList[i].GetName().Equals(cName),
                "USE OF NON-UNIQUE NAME: " + cName);
        }
    }

The assert will fire off -for example- when checking, “box1” and the only node in the list has the name “RootNode”.

I get the same unpredictable results using:
string == string and string.CompareTo(string) > 0

Any ideas? =\

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:08:46+00:00Added an answer on May 27, 2026 at 3:08 pm

    Assert is supposed to make sure the condition is TRUE. If it’s false the assert will fail.
    What you want is to assert that it’s NOT equal. use != and it should be fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first time posting here. I'm using a loop to create 3 buttons, but my
First time poster, so please excuse any stupidity. I'm working on porting a custom
Long time reader, first time poster. Working on a web site at http://www.howardpitch.com/ ,
First time poster. Im totally new to Android but I have manged to dreate
first time poster, but please help. I have been searching and reconfiguring for 6
Long time lurker, first time poster here. My question is: Using C# 2.0, is
Hey Everyone. I'm a first time poster, but I've browsed this site a number
Long time stackoverflow reader, first time poster. Forgive me if I'm not asking a
Long time user, first time poster. I've found similar questions/answers, typically involving subqueries, but
First time poster. I'm using MVVM-Light with Silverlight 4 and RIA Services. This has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.