; JsonErrorLine Example ; --------------------- ; Requires Extended mode. q$=Chr(34) ; Double-quote character, for building JSON text ; A save-game file that was corrupted: the error is on line 3 line1$="{" line2$=q+"player"+q+": "+q+"Aria"+q+"," line3$=q+"gold"+q+": 12x5" line4$="}" src$=line1+Chr(10)+line2+Chr(10)+line3+Chr(10)+line4 Print "Parsing this broken save-game:" Print "1: "+line1 Print "2: "+line2 Print "3: "+line3 Print "4: "+line4 Print "" save=ParseJson(src) Print "ParseJson returned "+save+" (0 = failed): "+JsonError() Print "" ; JsonErrorLine returns the one-based source line of the error - ; perfect for pointing an editor straight at the problem Print "JsonErrorLine: "+JsonErrorLine() Print "" Print "Press any key to close the example" WaitKey End