Command That Returns Component Mode?

Is there a command that will return the current component mode?
the
CODE
selectType
command will return a true or false state if i query a specific component mask, so i tried writing a simple proc to return a string, but i'm getting snytax errors on my else if statements...

CODE
proc string rkComponentMode()
{
int $modeVert = selectType -q -v;
int $modeEdge = selectType -q -eg;
int $modeFace = selectType -q -fc;
int $modeUV = selectType -q -puv;
string $curMode = "";

if ( $modeVert == 1 && $modeEdge == 0 && $modeFace == 0 && $modeUV == 0 )
    string $curMode = "Vertex";
    return $curMode;
else if ( $modeVert == 0 && $modeEdge == 1 && $modeFace == 0 && $modeUV == 0 )
    string $curMode = "Edge";
    return $curMode;    
else if ( $modeVert == 0 && $modeEdge == 0 && $modeFace == 1 && $modeUV == 0 )
    string $curMode = "Face";
    return $curMode;
else if ( $modeVert == 0 && $modeEdge == 0 && $modeFace == 0 && $modeUV == 1 )
    string $curMode = "UV";
    return $curMode;
else
    string $curMode = "Object";
    return $curMode;
}

you'd have to clamp your statements in the if request

CODE
if ( ($modeVert == 1) && ($modeEdge == 0) ...

but at 0 and 1 you can have it much simpler:

CODE
proc string rkComponentMode()
{
     int $modeVert = selectType -q -v;
     int $modeEdge = selectType -q -eg;
     int $modeFace = selectType -q -fc;
     int $modeUV = selectType -q -puv;

     if ($modeVert && !$modeEdge && !$modeFace && !$modeUV)
         return "Vertex";
     else if (!$modeVert && $modeEdge && !$modeFace && !$modeUV)
         return "Edge";    
     else if (!$modeVert && !$modeEdge && $modeFace && !$modeUV)
         return "Face";
     else if (!$modeVert && !$modeEdge && !$modeFace && $modeUV)
         return "UV";
     return "Object";
}

unfortunately this doesn't work for me ;] but good luck anyhow