; JsonErrorColumn Example ; ----------------------- ; Requires Extended mode. q$=Chr(34) ; Double-quote character, for building JSON text ; A save-game file that was corrupted 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 line1 Print line2 Print line3 Print line4 Print "" save=ParseJson(src) Print "ParseJson returned "+save+" (0 = failed): "+JsonError() Print "" ; JsonErrorColumn returns the one-based column on the error line col=JsonErrorColumn() Print "JsonErrorColumn: "+col+" (on line "+JsonErrorLine()+")" ; Use it to draw a marker under the offending character Print "" Print line3 Print String(" ",col-1)+"^ here" Print "" Print "Press any key to close the example" WaitKey End