delphidelphi-xeremobjects

How to create a newlist of newconstants for n parameters in REMOBJECTS DELPHI


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


Solution

  • 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)