Esempio n. 1
0
 public override object EXECUTE(params object[] po)
 {
     if (_all && _print)
     {
         return(printall(po));
     }
     else if (_all && _delete)
     {
         return(deleteall(po));
     }
     else if (_delete)
     {
         return(delete(po));
     }
     else
     {
         string s = po[0].ToString();
         MiMFa_CommandLanguage.CommandType type = MCL.TypeDetector(ref s, null).Key;
         bool allow =
             type != MiMFa_CommandLanguage.CommandType.Evaluatable &&
             type != MiMFa_CommandLanguage.CommandType.Property &&
             type != MiMFa_CommandLanguage.CommandType.Collection &&
             type != MiMFa_CommandLanguage.CommandType.Command &&
             type != MiMFa_CommandLanguage.CommandType.Comparable &&
             type != MiMFa_CommandLanguage.CommandType.String &&
             !MCL.IsSwitch(s) &&
             !MCL.IsSSwitch(s) &&
             type != MiMFa_CommandLanguage.CommandType.Function &&
             type != MiMFa_CommandLanguage.CommandType.MultiSlice &&
             !nonewcreate;
         if (_force ||
             (!s.Contains("=") &&
              !s.Contains(",") && allow))
         {
             MCL.AddVar(s, Null);
             return(Null);
         }
         if ((s.Contains("=") ||
              s.Contains(",")) && allow)
         {
             string[] stra = s.Split(',');
             _null = !_print;
             return(echo(stra));
         }
         else
         {
             throw new System.Exception("This name is not valid for variable");
         }
     }
 }