Je souhaite ajouter des éléments à un fichier Json sans passer par une "list" ou une "map".
Code : Tout sélectionner
If LoadJSON(#Json, "Initialisation.txt")
Debug ComposeJSON(#json, #PB_JSON_PrettyPrint) + #CRLF$ ; Ok
jsonObject = SetJSONObject(JSONValue(#json)) ; KO
jsonArray = AddJSONMember(jsonObject, "xxxx")
SetJSONArray(jsonArray)
jsonArrayElements = AddJSONElement(jsonArray)
SetJSONString(jsonArrayElements, "xxxx xxxxxxxxxx")
jsonArrayElements = AddJSONElement(jsonArray)
SetJSONString(jsonArrayElements, "19010101")
Endif
SaveJSON(#Json, "Initialisation.txt", #PB_JSON_PrettyPrint)
EndIf
Avez-vous une idée. je vous remercie par avance.
Belle et bonne nouvelle année.