Skip to content

sait/vfpjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

#VFPJSON JSON library for VFP. WARNING Too slow to used with large data

json_encode(xExpr)

Returns a string, that is the json of any expression passed.

json_decode(cJson)

Returns an object, from the string passed.

json_getErrorMsg()

Returns empty if no error found in last decode.

recordToJson()

Returns the json representation for current record.

tableToJson()

Returns the json representation for current table Warning need to be changed for large table, because use dimension aInfo[reccount()] For large table should change to create the string record by record.

###Examples

set procedure json additive

oPerson = json_decode(' { "name":"Ignacio" , "lastname":"Gutierrez", "age":33 } ')
if not empty(json_getErrorMsg())
	? 'Error in decode:'+json_getErrorMsg())
	return
endif
? oPerson.get('name') , oPerson.get('lastname')

obj = oJson.decode('{"jsonrpc":"1.0", "id":1, "method":"sumArray", "params":[3.1415,2.14,10],"version":1.0}')
? obj.get('jsonrpc'), obj._jsonrpc
? obj.get('id'), obj._id
? obj.get('method'), obj._method
? obj._Params.array[1], obj._Params.get(1)


cJson = ' {"server":"imap.gmail.com", "user":"billgates", "password":"melinda" , "port":895, "auth":false, "ssl":false, "timeout":20, "error":404}' 
? cJson
oSmtp = json_decode(cJson)
cJson =  json_encode(oSmtp)


? json_encode(_screen)

About

Json encoder and decoder for VFP Visual Fox Pro

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages