P
Peter Judge
Guest
I had the detail explained to me in short words that I can understand (thanks Fernando
The “fun” part of this is that this is perfectly legal syntax. Think about RUN foo (INPUT DATASET myDataset). Where PROCEDURE foo: DEF INPUT PARAM DATASET FOR myDataset. END. All good and proper. Now look at RUN foo (INPUT DATASET myDataset :HANDLE ). Where the leading portion is the same as the good, compiling code. The compiler cannot disambiguate between the intent to pass a DATASET and a HANDLE and so (to use a technical term) does a rainbow or technicolour yawn*. This is not a problem for tables because the keywords used differ RUN bar ( INPUT TEMP-TABLE ttData:HANDLE) RUN bar( INPUT BUFFER ttData:HANDLE) Where PROCEDURE bar: DEF INPUT PARAM TABLE FOR ttData. END. So while it smells buggy it isn’t and is not likely to change (for backwards compat reasons). Classes behave better; in 11.7 (at least) this works (compile and does what you think) class TestArray: def temp-table ttdata field d1 as dec . def dataset dsData for ttdata. method public void Foo ( input hdl as handle ): end method . method public void Foo ( input table for ttData): end method . method public void Foo ( input dataset for dsdata): end method . end class . def temp-table ttdata field d1 as dec . def dataset dsData for ttdata. def var o1 as TestArray. o1 = new TestArray(). o1:Foo( dataset dsData). o1:Foo( table ttData). o1:Foo( temp-table ttData: handle ). o1:Foo( dataset dsData: handle ). * barfs horribly
Continue reading...
Continue reading...