; JsonInteger Example
; -------------------

q$=Chr(34)  ; Double-quote character, for building JSON text

; A veteran's save-game: the total score needs 64 bits
save=ParseJson("{"+q+"player"+q+":"+q+"Aria"+q+","+q+"total_score"+q+":9000000000}")

score=JsonObjectGet(save,"total_score")

; Check the kind before a strict getter - JsonInteger on a
; non-integer kind is a programming error
If JsonKind(score)=JSON_INTEGER
    ; JsonInteger returns a signed 64-bit Long
    Print "total_score = "+JsonInteger(score)
    Print "That is well past the 32-bit limit of 2147483647."
Else
    Print "Save is corrupt: 'total_score' is not an integer"
EndIf

FreeJson score
FreeJson save

Print ""
Print "Press any key to close the example"
WaitKey

End
