P
Peter Judge
Guest
It happens I just have a need to do this. I ended up with this approach: when type-of(pData, JsonConstruct) then do: cast(pData, JsonConstruct):Write(mData). /* can never be */ if type-of(pData, JsonArray) then do: create temp-table hData. hData:read-json(DataTypeEnum:Memptr:ToString(), mData). end. else do: create dataset hData. hData:read-json(DataTypeEnum:Memptr:ToString(), mData) no-error. if error-status:error then delete object hData. if not valid-handle(hData) then do: create temp-table hData. hData:read-json(DataTypeEnum:Memptr:ToString(), mData) no-error. if error-status:error then delete object hData. end. end. if valid-handle(hData) then do: this-object:Write(hData). cast(this-object:Value, WidgetHandle):AutoDestroy = true. end. end. /* JSON */
Continue reading...
Continue reading...