Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alter Json with SuperObect

I'm using SuperObject to work with Json/Delphi I have a function that take a string and create a var superobject type, I need to check if it has an object (in my case is 'smtp') and if it don't, i create. The problem is: 'smtp' has children, example smtp.address and I have to create smtp and all its children, but my function doesn't work.

My Code:

if js.o['smtp'] = nil then
  js.o['smtp'].S['address']:= 'justATest';

Can anyone help me?

I'm using Delphi 2007 with SuperObject Unit

like image 431
Jaqueline Duque Avatar asked Jun 09 '26 10:06

Jaqueline Duque


1 Answers

if js['smtp'] = nil then
  js.S['smtp.address']:= 'justATest';
like image 90
Henri Gourvest Avatar answered Jun 11 '26 23:06

Henri Gourvest