public static string WarewolfAtomToString(DataASTMutable.WarewolfAtom a)
 {
     if (a == null)
     {
         return("");
     }
     return(a.ToString());
 }
Exemple #2
0
 public static string WarewolfAtomToString(DataASTMutable.WarewolfAtom a)
 {
     if (a == null)
     {
         return("");
     }
     return(PublicFunctions.AtomtoString(a));
 }
 public static string WarewolfAtomToStringErrorIfNull(DataASTMutable.WarewolfAtom a)
 {
     if (a == null)
     {
         return("");
     }
     if (a.IsNothing)
     {
         throw new NullValueInVariableException("Variable is null", "");
     }
     return(a.ToString());
 }
Exemple #4
0
 public string GetNextValue()
 {
     _currentValue++;
     if (_listResult != null)
     {
         if (_listResult.MoveNext())
         {
             _currentResult = _listResult.Current;
             return(ExecutionEnvironment.WarewolfAtomToString(_listResult.Current));
         }
         return(ExecutionEnvironment.WarewolfAtomToString(_currentResult));
     }
     return(null);
 }
 public string GetNextValue()
 {
     _currentValue++;
     if (_listResult != null)
     {
         if (_listResult.MoveNext())
         {
             _currentResult = _listResult.Current;
             return ExecutionEnvironment.WarewolfAtomToStringNullAsNothing(_listResult.Current);
         }
         return ExecutionEnvironment.WarewolfAtomToStringNullAsNothing(_currentResult);
     }
     return null;
 }
 public static string WarewolfAtomToStringNullAsNothing(DataASTMutable.WarewolfAtom a)
 {
     return(a == null ? null : (a.IsNothing ? null : a.ToString()));
 }
        static bool RunBetween(IEnumerable <DataASTMutable.WarewolfAtom> warewolfAtoms, IEnumerable <DataASTMutable.WarewolfAtom> tovals, DataASTMutable.WarewolfAtom a)
        {
            WarewolfListIterator iterator = new WarewolfListIterator();
            var from = new WarewolfAtomIterator(warewolfAtoms);
            var to   = new WarewolfAtomIterator(tovals);

            iterator.AddVariableToIterateOn(@from);
            iterator.AddVariableToIterateOn(to);
            while (iterator.HasMoreData())
            {
                var fromval = iterator.FetchNextValue(@from);
                var toVal   = iterator.FetchNextValue(to);

                DateTime fromDt;
                if (DateTime.TryParse(fromval, out fromDt))
                {
                    DateTime toDt;
                    if (!DateTime.TryParse(toVal, out toDt))
                    {
                        throw new InvalidDataException("IsBetween Numeric and DateTime mis-match");
                    }
                    DateTime recDateTime;
                    if (DateTime.TryParse(a.ToString(), out recDateTime))
                    {
                        if (recDateTime > fromDt && recDateTime < toDt)
                        {
                            return(true);
                        }
                    }
                }
                double fromNum;
                if (double.TryParse(fromval, out fromNum))
                {
                    double toNum;
                    if (!double.TryParse(toVal, out toNum))
                    {
                        return(false);
                    }
                    double recNum;
                    if (!double.TryParse(a.ToString(), out recNum))
                    {
                        continue;
                    }
                    if (recNum > fromNum && recNum < toNum)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }