C
cverbiest
Guest
The OpenEdge compiler doesn't know (enough) about method return values. It should be aware of the return values of methods so that they can be used directly without the need for intermediate variables. Below is just one example, I've seen place where object:attribute:method() needs to be split into several statements to please the compiler. Example : The JsonObject:GetNames() returns a character array but the compiler fails with following error Only indeterminate array variables (defined with no numeral after EXTENT) are allowed as parameters for the EXTENT statement. (14901) when compiling the code below This can be worked around by defining an intermediate variable but this should not be necessary. *------------------------------------------------------------------------ File : JsonPropertyCollection Purpose : Demonstrate incorrect error 14901 Syntax : Description : Only indeterminate array variables (defined with no numeral after EXTENT) are allowed as parameters for the EXTENT statement. (14901) on line 24 ----------------------------------------------------------------------*/ using Progress.Json.ObjectModel.JsonObject from propath. block-level on error undo, throw. class JsonPropertyCollection: define private property JsonObject as JsonObject no-undo get. set. constructor public JsonPropertyCollection(): JsonObject = new JsonObject(). end constructor. define public property NumProperties as integer no-undo get(): return extent(JsonObject:GetNames()). end get. end class.
Continue reading...
Continue reading...