Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISuperArray Delete function Incorrect #131

Open
gorepj opened this issue Apr 5, 2020 · 0 comments
Open

ISuperArray Delete function Incorrect #131

gorepj opened this issue Apr 5, 2020 · 0 comments

Comments

@gorepj
Copy link

gorepj commented Apr 5, 2020

I find that the Delete function does not correctly delete all matches from an array
Example below does not delete all where make = "Audi". Delphi 10.3
procedure MyProc: TObject);
var
FilterJSON: ISuperObject;
begin
FilterJSON := XSuperobject.SO('{ Vehicles: [ '+
' { '+
' make: "Audi", ' +
' model: "A2", ' +
' type: "Saloon", '+
' price: 12300' +
' }, '+
' { '+
' make: "Audi", ' +
' model: "A4", ' +
' type: "Saloon", '+
' price: 19800' +
' }, '+
' { '+
' make: "Audi", ' +
' model: "A6", ' +
' type: "Saloon", '+
' price: 24000' +
' }, '+
' { '+
' make: "Ford", ' +
' model: "Sierra", ' +
' type: "Saloon", '+
' price: 16500' +
' }, '+
' { '+
' make: "Ford", ' +
' model: "Transit", ' +
' type: "Van", '+
' price: 25000' +
' }, '+
' { '+
' make: "Nissan", ' +
' model: "Qashqai", ' +
' type: "Saloon", '+
' price: 22000' +
' } '+
' ] '+
'}');
Mmo.Lines.Add(
FilterJSON.A['Vehicles'].Delete(function(Arg: IMember): Boolean
begin
with Arg.AsObject do
Result := (S['make'] = 'Audi')
end).AsJSON(true)
);

end;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant