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()