Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
34
Task/JSON/PureBasic/json.basic
Normal file
34
Task/JSON/PureBasic/json.basic
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
OpenConsole()
|
||||
If CreateJSON(1)
|
||||
PB_Team_Members=SetJSONObject(JSONValue(1))
|
||||
SetJSONString(AddJSONMember(PB_Team_Members,"PB_Team_Member_1"),"Frederic Laboureur")
|
||||
SetJSONString(AddJSONMember(PB_Team_Members,"PB_Team_Member_2"),"Andre Beer")
|
||||
SetJSONString(AddJSONMember(PB_Team_Members,"PB_Team_Member_3"),"Timo Harter")
|
||||
EndIf
|
||||
|
||||
If CreateJSON(2)
|
||||
Former_Team_Members=SetJSONArray(JSONValue(2))
|
||||
SetJSONString(AddJSONElement(Former_Team_Members),"Richard Andersson")
|
||||
SetJSONString(AddJSONElement(Former_Team_Members),"Benny Sels")
|
||||
SetJSONString(AddJSONElement(Former_Team_Members),"Danilo Krahn")
|
||||
EndIf
|
||||
|
||||
PrintN("PureBasic - Team Members:")
|
||||
PrintN(ComposeJSON(1,#PB_JSON_PrettyPrint)+#CRLF$)
|
||||
PrintN("PureBasic - Former Team Members:")
|
||||
PrintN(ComposeJSON(2,#PB_JSON_PrettyPrint)+#CRLF$)
|
||||
|
||||
#DL=Chr(34)
|
||||
PB_Special_thanks$="[ " +#DL+"Gary Willoughby"+#DL+", " +#DL+"Mark James"+#DL+", " +#DL+"Neil Hodgson"+#DL+" ]"
|
||||
NewList otherpersons.s()
|
||||
|
||||
If ParseJSON(3,PB_Special_thanks$)
|
||||
ExtractJSONList(JSONValue(3),otherpersons())
|
||||
PrintN("Pure Basic - and others:")
|
||||
ForEach otherpersons() : PrintN(otherpersons()) : Next
|
||||
Else
|
||||
PrintN(JSONErrorMessage() + " : " + Str(JSONErrorPosition()))
|
||||
PrintN(Left(PB_Special_thanks$,JSONErrorPosition()))
|
||||
PrintN(Mid(PB_Special_thanks$,JSONErrorPosition()+1))
|
||||
EndIf
|
||||
Input()
|
||||
Loading…
Add table
Add a link
Reference in a new issue