Change value of an item in Tjsonobject - Pascal

Asked

Viewed 8 times

0

I have the following code :

uses
Classes, SysUtils, CustApp, fpjson, jsonparser ;

var  
jsonEx4 : TJSONObject;
begin
  //Inicio do Exercicio 4
  jsonEx4:=TJSONObject.Create([
    'TProposta', TJSONObject.Create([
      'Ativo', '',
      'DiaVencimento', '0'
    ]),
    'TCamposExtrasEntidades', TJSONObject.Create([
      'F4B1', ''
    ]),
    'TPropostaItems', TJSONArray.Create([
      TJSONObject.Create([
        'Chave', '92EDC',
        'Ex', '0'
      ])
    ]),
    'TPropostaPagamentos', TJSONArray.Create([
      TJSONObject.Create([
        'Chave', '522',
        'Ex', '0'
      ])
    ])
  ]);
  Terminate;
end;

I would like to create a code that accesses JSON and changes the Asset value in the Tproposta item to '10'.

I’m using Free Pascal and Lazarus.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.