Closed jhernancanom closed 1 year ago
Check the latest version. First version that implemented fast parsing returned the original JS object, which can not be processed by Beautify method. Latest versions applied a normalization process so now the result obtained with normal parsing or fast parsing is exactly the same and can be beautified.
Check this test using last version;
DO JSON
?JSON.Beautify('{ "firstName" : "Victor", "lastName": "Espina", "YOB": 1970 }')
JSON.useFastParser = .T.
?JSON.Beautify('{ "firstName" : "Victor", "lastName": "Espina", "YOB": 1970 }')
JSON.NormalizeResults = .F.
?JSON.Beautify('{ "firstName" : "Victor", "lastName": "Espina", "YOB": 1970 }')
Chévere, colega. Muchísimas gracias.
El mié, 7 dic 2022 a la(s) 09:02, Victor Espina escribió:
Check the latest version. First version that implemented fast parsing returned the original JS object, which can not be processed by Beautify method. Latest versions applied a normalization process so now the result obtained with normal parsing or fast parsing is exactly the same and can be beautified.
Check this test using last version;
DO JSON
?JSON.Beautify('{ "firstName" : "Victor", "lastName": "Espina", "YOB": 1970 }')
JSON.useFastParser = .T.
?JSON.Beautify('{ "firstName" : "Victor", "lastName": "Espina", "YOB": 1970 }')
JSON.NormalizeResults = .F.
?JSON.Beautify('{ "firstName" : "Victor", "lastName": "Espina", "YOB": 1970 }')
—Message ID: @.***>
Hola, Víctor. Ejecuto en VFP9 y obtengo lo que hay en la primera imagen. OK. Ejecuto en VFPA-x64 y obtengo lo que hay en la segunda imagen.
Hola Hernan. No habia visto este post. En el caso del fastparsing quizas el problema viene por el uso del componente VBScript desde un ambiente 64bits. Sin embargo, eso no explica porque no funciona el beautify con el parsing normal. Lamentablemente no trabajo con VFPA (aun) asi que no te sabria decir porque no funciona, pero lo tendre en cuenta para revisarlo en cuanto tenga oportunidad.
When useFastParser = .T. then Beautify returns null.
I tried the samples in ReadMe.