This project is read-only.


Rating:        Based on 1 rating
Reviewed:  1 review
Downloads: 820
Released: Mar 10, 2017
Updated: May 30, 2017 by mplazac
Dev status: Stable Help Icon


Application nfJson
application, 1K, uploaded May 30, 2017 - 820 downloads

Release Notes

fixed: proper support for 19 character strings with ISO basic date format & different strictdate settings.

nfJsonRead bug fix: incorrect parsing for strings terminated with escaped double quotes;
minor changes & code refactoring.

nfJsonRead: incorrect unescaped output with "set exact = on"
escapetest.prg - removed "leftover" lines.

fixed issue escaping values terminated with "
nfJsonRead: removed parameter "isFile" now you can just pass a file name or string
added test: escapeTest.prg

minor bug fix: zero item collections created as 1 empty item collection
proper indent for raw/formatted collection objects

added compiled exe
samples file ships as a separate file for you to edit
fixed bug on test prgs:
clean installs would fail due to missing temp folder on ditribution zip w/o tests\temp folder
fixed bug on collectionTest

nfJsonRead: Improved error management
CollectionTest: added new test

  • Fixed bug: missing closing curly brace on collections as object member
  • Updated collections program test

  • Automatic cast for datetime properties ( ISO-8601 basic format & vfp compilant as described on )
  • nfJsonToCursor Bug Fix: "Date/datetime evaluated to an invalid value" while running under "strictdate = 1" converting empty dates back from Json

  • Added support for control characters encoding ( chr( 0) ~ chr(31) )

  • invalid Json error shows calling program information

  • complex nested objects/arrays validation
  • missing object/array closures validation

  • nfJsonRead performs JSON validation: invalid Json throws error indicating reason.
  • nfJsonPerfTest: proper error management enabled for invalid Json input from clipboard
  • nfJsonToCursor: use of strict date format

Functions & Usage:

( Each function is a single prg - No additional dependencies / Requires VFP9 )
  • oJson = nfJsonRead(cJsonString , isFileName,lReviveCollections)
  • cJsonString = nfJsonCreate(oVfp, lFormattedOutput, lNoNullArrayItems,cRootName,aMembersFlag)
  • nfJsonToCursor(cJson, cCursorName , lForceImportFromArray) ( creates cursor back from Json created using nfCursorToJson4vfp )
  • nfCursorToJson4vfp() && converts current open table/cursor to Json suitable for later use of nfJsonToCursor()
  • nfCursorToJson(lReturnArray, lArrayofValues, lIncludestruct, lFormattedOutput) && converts current open table/cursor to Json
  • nfCursorToObject(lCopyToArray, lIncludeStruct)

Tests & Sample files:

  • nfJsonPerfTest.prg: just run it and choose one of the embedded json samples from the list to check performance on your pc. ( Allows you to parse Json from clipboard too. )
  • examples.prg will parse the next Json files included in JsonSamples folder. just run from test folder and see sample code and output.
  • collectionTest.prg: creates a complex collection , converts it to Json and back to vfp.
  • Sample Json files included:
    • youtubesearch.json
    • cycloneForecast.json
    • dropbox.json
    • googleMapsDistance.json
    • iphone photo.json
    • mapquest.json
    • mySimpleArray.json
    • tweeter.json
    • weatherService.json
    • yahooweather.json

Reviews for this release

I like it cause it works in vfp 9 perfectly. But nfjsonperftest.PRG is more than 65000 bytes so it can not be used in VFP 8. What to do with nfjson class to enable it for VFP 8?
by AdamAry on Aug 19, 2016 at 11:34 AM
nfJson uses alines() features present only on vfp9, and the empty object class. You can try Vilhelm-Ion Praisach's alines() compatible function , kindly shared on this foxite thread: Additional notes changes needed to source code to add compatibility inside this release. nfJsonperfTest had embedded json samples ( the cause of file size ) , they now ship as a separate file you can edit.
Reply by mplazac (N/A) on Aug 20, 2016 at 5:52 PM