Txt-Name is unique in objects

From Vectorlab
Jump to: navigation, search


Function to check if a name is unique among objects. The name could be existing in layers but this doesn't interest us. Load the routine T_NameUniqueLayers before using this. By Orso B. Schmid


{ Orso *********************************************** }
{ check NameList for name unicity, ignoring layers }
FUNCTION T_NameUniqueObjects(str: STRING): BOOLEAN;
	BEGIN
		T_NameUniqueObjects := (
		((getObject(str) = NIL) & NOT T_NameUniqueLayers(str)) |
		((getObject(str) = NIL) & T_NameUniqueLayers(str))
		);
		
		{ 
		This redundant boolean because if the nameList doesn't include an
		object with that name, getObject will search the LayerList, thus 
		eventually returning <> NIL
		}
	END;