'Code module
#Region Project Attributes
#ApplicationLabel: B4i Json
#Version: 1.0.0
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#Target: iPhone, iPad
#ATSEnabled: True
#MinVersion: 7
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
End Sub
Sub JsonToMap(strJSON As String) As Map
' convert a json string to a map
Dim jMap As Map
jMap.Initialize
Dim JSON As JSONParser
JSON.Initialize(strJSON)
jMap = JSON.NextObject '<<<< failing
Return jMap
End Sub
Private Sub Application_Start (Nav As NavigationController)
'SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed.
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
NavControl.ShowPage(Page1)
Dim jsonLine As String
jsonLine = $"{a:"a",b:"b",c:"c",d:"d",e:"e"}"$
Log(jsonLine)
JsonToMap(jsonLine)
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
End Sub
Private Sub Application_Background
End Sub