Check Json Support

K4sh

Member
Hey there,
Is there a way to check in a speedscript if JSON is supported (CGI env vars etc ...) ?
The aim is to call JSON as much as possible and to have a fallback if Progress version is prior to 10.2B.
 
I suppose it depends on the definition of "easy". ;) It's maybe not a trivial comparison, but you can parse out the proversion output and make it work for you. Compare the part before the decimal to 10, then compare the digit(s) after the period to 2, compare the string after that to "B", etc.
 
You've said it. Not a trivial comparision.
The reason why i would expect some kind of boolean variable or close to just to be sure it is supported.
 
I'm not familiar with SpeedScript, but would this work?

Code:
def temp-table t no-undo field f as char.
def var h as handle no-undo.
h = temp-table t:handle.
disp can-query(h,"WRITE-JSON").

The temp-table is here only so I can query its WRITE-JSON method. It's not actually doing anything.

If this works, it's probably preferable to looking at version numbers.[/code]
 
Back
Top