Twice today I've copied and pasted code from the documentation, and twice I've gotten syntax errors
#1
using Progress.Json.ObjectModel.*.
DEFINE VARIABLE myLongchar AS LONGCHAR NO-UNDO.
DEFINE VARIABLE myParser AS ObjectModelParser NO-UNDO.
DEFINE VARIABLE Request AS JsonConstruct NO-UNDO.
DEFINE VARIABLE settings AS JsonObject NO-UNDO.
myParser = NEW ObjectModelParser(myLongchar).
settings = CAST(myParser:Parse(), JsonObject).
Request = myParser:Parse(&WEBSTREAM).
gives the error
"Mismatched number of parameters supplied to 'ObjectModelParser', expecting 0 but 1 were specified (2680)
#2
from the help guide within PDS
def temp-table ttorder like order.
def temp-table ttorderline like order-line.
DEFINE VARIABLE hDset AS HANDLE NO-UNDO.
DEFINE VARIABLE hRel AS HANDLE NO-UNDO.
CREATE DATASET hDset.
hDset:SET-BUFFERS(BUFFER ttOrder:HANDLE, BUFFER ttOrderLine:HANDLE).
hRel = hDset:ADD-RELATION(BUFFER ttOrder:HANDLE, BUFFER ttOrderLine:HANDLE,
"ttOrder.OrderNum,ttOrderLine.OrderNum").
gives the error shown in the attached screenshot.
This is simply ridiculous. I can perhaps understand code examples not being best practice (although they should be) , but I cannot understand code that simply does not work or even compile.
Inexcusable.
Does anyone have any decent documentation on the progress json parser ?
Julian
Good points all around -- code samples should indeed work reliably. I will pass this thread on to the Progress documentation team, who do indeed care a lot about errors like this.