- Joe Hess II
- PowerServer 2020 or older (Obsolete)
- Friday, 6 December 2019 09:07 PM UTC
I'm trying to use JSONParser with PowerServer 2019, Build 2082. In the code below, ls_error is an empty string after i call LoadString. According to the documentation, LoadString should return an empty string if successful, or null if an error occurs. GetRootItem returns 0 which is not documented unless 0 is a valid pointer.
I suspect something is (not) happening with LoadString. Any ideas? This works with PowerBuilder.
Thank you,
Joe
ip_jsonp = CREATE JSONPARSER
ls_json = '{"firstName":"Joe"}'
ls_Error = ip_jsonp.LoadString(ls_json)
IF (LEN(trim(ls_Error)) > 0) THEN
Messagebox("Failed","Loan json failed : "+ ls_Error)
RETURN -1
ELSEIF ( IsNull (ls_error) ) THEN
MessageBox ( "Failed", "Load JSON Failed.")
RETURN -1
END IF
ll_root = ip_jsonp.GetRootItem()
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.