DA Error using WhereExpression from settings file

I’m using WhereParser.Parse with the string contents of a KVP in Settings.settings which contains the text of
the WhereExpression. The parser gives me a DA exception ‘EOF expected, but : 64269083 found’ when I try to
execute the Parse command. Curious because the specification for this input is simply string. I’m not sure why the
expectation of EOF.

Thanks,
Monte

Hello

Please provide the string you’re trying to parse and exact code you use. If you don’t want to disclose it here then send the required data to support@

Thanks in advance

Anton,

        new BinaryExpression(
                      new BinaryExpression(
                          new BinaryExpression(
                              new FieldExpression("YMDEFF"),
                              new ParameterExpression("As_Of_Date", DataType.LargeInt, 0),
                              BinaryOperator.LessOrEqual),
                          new BinaryExpression(
                              new FieldExpression("YMDEND"),
                              new ParameterExpression("As_Of_Date", DataType.LargeInt, 0),
                              BinaryOperator.GreaterOrEqual),
                          BinaryOperator.And),
            //new BinaryExpression(
            //new BinaryExpression(
            //    new FieldExpression("VOID"),
            //    new ConstantExpression(" ", DataType.String),
            //    BinaryOperator.Equal),
                          new BinaryExpression(
                              new FieldExpression("MEMBER_NBR"),
                              new ParameterExpression("Member_Nbr", DataType.WideString, 12),
                              BinaryOperator.Equal),
            //BinaryOperator.And),
                      BinaryOperator.And);

Hello

Sorry, not sure I understand your answer. I’ve asked for a string you try to parse and exact code you use to do this while you provide some code that constructs a BinaryExpression, w/o any other explanations.

Here is the line of code in question…
dynamicWhere = WhereParser.Parse(Properties.Settings.Default.wsGetMemberInfoDSDefault.ToString());

The earlier code is stored as a setting.

Thanks,
Monte

Hello

The purpose of the WhereParser class is completely different: http://wiki.remobjects.com/wiki/WhereParser_Class

The code you need would look like

using System;
using RemObjects.DataAbstract.Expressions;
using RemObjects.DataAbstract.Schema;

namespace ConsoleApplication2
{
	class Program
	{
		static void Main(string[] args)
		{
			var expression = new BinaryExpression(
					  new BinaryExpression(
						  new BinaryExpression(
							  new FieldExpression("YMDEFF"),
							  new ParameterExpression("As_Of_Date", DataType.LargeInt, 0),
							  BinaryOperator.LessOrEqual),
						  new BinaryExpression(
							  new FieldExpression("YMDEND"),
							  new ParameterExpression("As_Of_Date", DataType.LargeInt, 0),
							  BinaryOperator.GreaterOrEqual),
						  BinaryOperator.And),
						  new BinaryExpression(
							  new FieldExpression("MEMBER_NBR"),
							  new ParameterExpression("Member_Nbr", DataType.WideString, 12),
							  BinaryOperator.Equal),
					  BinaryOperator.And);

			var xml = expression.ToXmlString();

			var expression2 = WhereExpression.FromString(xml);

			Console.WriteLine("Successfully parsed");

			Console.ReadKey();
		}
	}
}

Regards

Anton,

Thanks. Those two notes actually helped a lot. I got it working with WhereParser.Parse.

Monte

Anton,

In DA 9 .Net version, will sequential Binary Expressions be supported? They seem to be in Delphi.

Thanks,
Monte

Hello.

Most probably not in 9.0 (doesn’t fit into the deadline). However we’ll try to implement them in 9.1

Regards

Thanks, logged as bugs://74054

Anton,

Is there a way to track the bug below?

Thanks,
Monte

Notification will be posted in this thread once the bug is fixed.

bugs://74054 got closed with status fixed.