model_server/gala/src/dis_cmds.cxx
//
// Returns the number of items in a given selection:
//
Returns the number of items in a given selection.
Returns the number of items in a given selection .
int dis_sel_size(ClientData, Tcl_Interp *interp, int argc, char *argv[])
{
  int ret = TCL_ERROR;
  gString usage;
  usage.sprintf((vchar *)"Usage: %s <selection>", argv[0]);
  if (argc == 2) {
    int nsel = 0;
    SelectionIterator it((vchar *)argv[1]);
    while (it.Next()) {
      ++nsel;
    }
    gString result;
    result.sprintf((vchar *)"%d", nsel);
    Tcl_SetResult (interp, (char *)result, TCL_VOLATILE);
    ret = TCL_OK;
  }
  else
    Tcl_AppendResult(interp, (char *)usage, NULL);
  return ret;
}
int dis_sel_size ( ClientData , Tcl_Interp * interp , int argc , char * argv [ ] ) { int ret = TCL_ERROR ; gString usage ; usage . sprintf ( ( vchar * ) " " , argv [ 0 ] ) ; if ( argc == 2 ) { int nsel = 0 ; SelectionIterator it ( ( vchar * ) argv [ 1 ] ) ; while ( it . Next ( ) ) { ++ nsel ; } gString result ; result . sprintf ( ( vchar * ) " " , nsel ) ; Tcl_SetResult ( interp , ( char * ) result , TCL_VOLATILE ) ; ret = TCL_OK ; } else Tcl_AppendResult ( interp , ( char * ) usage , NULL ) ; return ret ; }
Returns the number of items in a given selection:
Returns the number of items in a given selection :