1

i am currently trying to do a dynamicwhere expression with dboin, i need to create a list of new constants, i found out that the way to do it is this:

Expression:=NewBinaryExpression(
            NewField(LogicalName,'City'), NewList(
           [NewConstant('Chicago IL',datString),
            NewConstant('Seattle WA',datString),
            NewConstant('Portland OR',datString)]),
           dboIn);

My question is: is there a way to do that list but with n parameters? if so please tell me because ive been dealing with this like for a day now.

with n parameters i mean that there are 3 parameters in code, but i need to do it for 4,5,6,7 or 8 parameters

Jp191290
  • 51
  • 8
  • Your code seems to suggest that `NewList` expects an *array* of `NewContant` values. You could try filling a dynamic array and passing that to `NewList`. – Rob Kennedy Jul 08 '15 at 20:57

1 Answers1

2
ll := TDAListExpression.Create;

ll.Add(NewConstant('Chicago IL',datString));
ll.Add(NewConstant('Seattle WA',datString));
ll.Add(NewConstant('Portland OR',datString)); 

Expression := NewBinaryExpression(
  NewField(LogicalName,'City'), 
  ll,
  dboIn)
  • man ever had one of those duh moments,, well this is for me, didnt know it was this easy, had a problem knowing wich kind of list it was but this is just awesome ty dude – Jp191290 Jul 09 '15 at 16:30