wrote in message
news:5683828@discussion.autodesk.com...
Can we test for a key in a dictionary without using the IDictionary
Enumerator and testing the whole dictionary. I was hoping for a retun
code similar to ARX eKeyNotFound when using dict.GetAt but this
just throws a system error when not found.
Thanks!
wrote in message news:5684696@discussion.autodesk.com...
I try to keep my trys for the unexpected but since it's an IDict it's
either this or the loop. Thanks.
How about this code
static public bool HasKey(DBDictionary dbDict, string dictKey)
{
try
{
ObjectId id = dbDict.GetAt(dictKey);
return true;
}
catch
{
return false;
}
}
wrote in message
news:5684696@discussion.autodesk.com...
I try to keep my trys for the unexpected but since it's an IDict it's
either this or the loop. Thanks.
How about this code
static public bool HasKey(DBDictionary dbDict, string dictKey)
{
try
{
ObjectId id = dbDict.GetAt(dictKey);
return true;
}
catch
{
return false;
}
}
wrote in message news:5685742@discussion.autodesk.com...
Nothing wrong with Contains() it's the coder...:) Thanks!
"Tony Tanzillo"
news:5685719@discussion.autodesk.com...
Paul - What's wrong with the Contains() method ?
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
"Paul Richardson"
wrote in message
news:5684696@discussion.autodesk.com...
I try to keep my trys for the unexpected but since it's an IDict it's
either this or the loop. Thanks.
How about this code
static public bool HasKey(DBDictionary dbDict, string dictKey)
{
try
{
ObjectId id = dbDict.GetAt(dictKey);
return true;
}
catch
{
return false;
}
}
wrote in message
news:5685742@discussion.autodesk.com...
Nothing wrong with Contains() it's the coder...:) Thanks!
"Tony Tanzillo"
news:5685719@discussion.autodesk.com...
Paul - What's wrong with the Contains() method ?
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
"Paul Richardson"
wrote in message
news:5684696@discussion.autodesk.com...
I try to keep my trys for the unexpected but since it's an IDict it's
either this or the loop. Thanks.
How about this code
static public bool HasKey(DBDictionary dbDict, string dictKey)
{
try
{
ObjectId id = dbDict.GetAt(dictKey);
return true;
}
catch
{
return false;
}
}
wrote in message news:5685742@discussion.autodesk.com...
Nothing wrong with Contains() it's the coder...:) Thanks!
"Tony Tanzillo"
news:5685719@discussion.autodesk.com...
Paul - What's wrong with the Contains() method ?
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
"Paul Richardson"
wrote in message
news:5684696@discussion.autodesk.com...
I try to keep my trys for the unexpected but since it's an IDict it's
either this or the loop. Thanks.
How about this code
static public bool HasKey(DBDictionary dbDict, string dictKey)
{
try
{
ObjectId id = dbDict.GetAt(dictKey);
return true;
}
catch
{
return false;
}
}