[JSON] Utilisation de l'API SuperObject
Bonjour,
J'essaye d'utiliser l'API SuperObject de Progdigy, mais sans succès :(.
D'abord j'ai essayé comme ça :
Code:
1 2 3 4 5 6 7 8 9 10 11
| procedure Test1();
var
soJSON: TSuperObject;
begin
soJSON := TSuperObject.Create('{"toto":"tutu"}');
try
WriteLn(soJSON.S['toto']);
finally
soJSON.Free();
end;
end; |
Mais je n'ai aucun résultat.
Alors j'ai suivis l'aide succincte disponible sur le Wiki.
Code:
1 2 3 4 5 6 7
| procedure Test2();
var
soJSON: ISuperObject;
begin
soJSON := SO('{"toto":"tutu"}');
WriteLn(soJSON.S['toto']);
end; |
Mais là j'ai droit à une violation d'accès :cry:.
Quelqu'un a déjà utilisé cette API. Et si oui, comment ?