Clean up for release
This commit is contained in:
parent
fe6be93205
commit
4c6e9ecc65
12 changed files with 0 additions and 3 deletions
66
variants/jsonlib copy.pb
Executable file
66
variants/jsonlib copy.pb
Executable file
|
@ -0,0 +1,66 @@
|
|||
UseSQLiteDatabase()
|
||||
|
||||
; worry about the database init later
|
||||
|
||||
OpenDatabase(0,"json.db","","",#PB_Database_SQLite)
|
||||
|
||||
LoadJSON(1,"results.json");ParseJSON(1, json$) ; returns garbage without the PB ascii there not sure why
|
||||
|
||||
ParseJSON(1, json$) ; returns garbage without the PB ascii there not sure why
|
||||
ObjectValue = JSONValue(1)
|
||||
|
||||
If ExamineJSONMembers(ObjectValue)
|
||||
While NextJSONMember(ObjectValue)
|
||||
|
||||
Debug "Key: " + JSONMemberKey(ObjectValue)
|
||||
|
||||
MemberValue = JSONMemberValue(ObjectValue)
|
||||
|
||||
|
||||
; Now extract the actual value based on its type
|
||||
Select JSONType(MemberValue)
|
||||
Case #PB_JSON_String
|
||||
Debug "Value (String): " + GetJSONString(MemberValue)
|
||||
|
||||
|
||||
Case #PB_JSON_Number
|
||||
Debug "Value (Number): " + StrD(GetJSONDouble(MemberValue))
|
||||
|
||||
|
||||
Case #PB_JSON_Boolean
|
||||
Debug "Value (Boolean): " + Bool(GetJSONBoolean(MemberValue))
|
||||
|
||||
|
||||
Case #PB_JSON_Object
|
||||
Debug "Value (Object): (nested object)"
|
||||
; You could further examine this nested object if needed.
|
||||
|
||||
|
||||
Case #PB_JSON_Array
|
||||
Debug "Value (Array): (nested array)"
|
||||
; Handle array values if needed.
|
||||
|
||||
|
||||
Default
|
||||
Debug "Value (Unknown type)"
|
||||
|
||||
EndSelect
|
||||
|
||||
|
||||
Wend
|
||||
|
||||
endif
|
||||
|
||||
|
||||
|
||||
|
||||
; IDE Options = PureBasic 6.12 LTS (Linux - x64)
|
||||
; CursorPosition = 43
|
||||
; FirstLine = 33
|
||||
; Folding = -
|
||||
; EnableXP
|
||||
; DPIAware
|
||||
; IDE Options = PureBasic 6.12 LTS (Linux - x64)
|
||||
; CursorPosition = 9
|
||||
; EnableXP
|
||||
; DPIAware
|
Loading…
Add table
Add a link
Reference in a new issue