; JsonObjectGet Example ; --------------------- ; Requires Extended mode. q$=Chr(34) ; Double-quote character, for building JSON text ; A loaded save-game record save=ParseJson("{"+q+"player"+q+":"+q+"Aria"+q+","+q+"gold"+q+":1250}") Print "Save-game: "+JsonStringify(save,0) Print "" ; JsonObjectGet returns an OWNED deep copy of the property gold=JsonObjectGet(save,"gold") Print "gold handle = "+gold+", value = "+JsonInteger(gold) ; An absent key returns zero - no error, no diagnostics change mount=JsonObjectGet(save,"mount") Print "mount handle = "+mount+" (0 means the key is absent)" Print "" If mount=0 Then Print "Aria still travels on foot." FreeJson mount ; FreeJson 0 is safe FreeJson gold FreeJson save Print "" Print "Press any key to close the example" WaitKey End