ExcelFormulaParser.Engine.Excel.Functions.RefAndLookup.LookupNavigator.MoveNext C# (CSharp) Method

MoveNext() public method

public MoveNext ( ) : bool
return bool
        public virtual bool MoveNext()
        {
            if (!HasNext()) return false;
            if (_direction == LookupDirection.Vertical)
            {
                _currentRow++;
            }
            else
            {
                _currentCol++;
            }
            Index++;
            SetCurrentValue();
            return true;
        }

Usage Example

示例#1
0
        protected CompileResult Lookup(LookupNavigator navigator, LookupArguments lookupArgs)
        {
            object lastValue       = null;
            object lastLookupValue = null;
            int?   lastMatchResult = null;

            do
            {
                var matchResult = IsMatch(navigator.CurrentValue, lookupArgs.SearchedValue);
                if (matchResult == 0)
                {
                    return(CreateResult(navigator.GetLookupValue(), DataType.String));
                }
                if (lookupArgs.RangeLookup)
                {
                    if (lastValue != null && matchResult > 0 && lastMatchResult < 0)
                    {
                        return(CreateResult(lastLookupValue, DataType.String));
                    }
                    lastMatchResult = matchResult;
                    lastValue       = navigator.CurrentValue;
                    lastLookupValue = navigator.GetLookupValue();
                }
            }while (navigator.MoveNext());

            throw new ExcelFunctionException("Lookupfunction failed to lookup value", ExcelErrorCodes.NoValueAvaliable);
        }
All Usage Examples Of ExcelFormulaParser.Engine.Excel.Functions.RefAndLookup.LookupNavigator::MoveNext