Hi Guys
I have declared a List that hold instances of a class describing objects (name, etc.). Before adding an object description to the list, I want to check if it is already in the list.
The object description I want to add resides in a single instance of the class and is called “currentObject”. The list of object descriptions is called objectList. I made the following for loop:
//Check if the object has already been logged in the list
for (i=0; i < objectList.Count; i++){
if (objectList*.objectName == currentObject.objectName) {*
objectAlreadyInList = true;
}
}
I do not get any syntax errors, but when running this loop it seems that the logical compare of the names actually assigns “currentObject.objectName” to “objectList*.objectName”?*
Is it not allowed to compare strings in this way?
I am new to this - sorry if it is a dumb question