I'm trying to test if a SelectionSet is empty. I've got a compiler error: "Use of unassigned local variable", but I can't see what I'm supposed to do. See this short code: --help !!--thanks--
static public void usr_select()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
SelectionSet sset; // <--------------------------------------
PromptSelectionResult ssget;
ssget = ed.SelectImplied(); // Get the PickFirst selection set
if (ssget.Status == PromptStatus.OK)
{
sset = ssget.Value;
}
else
{
ssget = ed.GetSelection(); // Prompt for selection
if (ssget.Status == PromptStatus.OK)
{
sset = ssget.Value;
}
}
if (sset.Count > 0) // Error: Use of unassigned local variable 'sset'
{
// main program
}
}