2
Vote

Numerically named attributes

description

As someone coming new to the world of JSON I have found this class incredibly useful, so many thanks to all involved in its development.

I have discovered a problem which I suspect will be straight-forward enough to fix - when parsing JSON which includes attributes whose name begins with a numeric digit you receive an error 1470 "Incorrect property name". VFP doesn't allow properties with names whose first character is numeric and so the line below in the Parse() method throws this error.

ADDPROPERTY(oResult,cProp,uValue)

I am going to experiment with trapping for this case and prepending an underscore to the property name. Can anyone who is more familiar with qdfoxJSON or with the workings of JSON in general see any problems with this approach?

Many thanks,
Paul

comments