I would expect that the compiler wines on this call, because I am not using the OUTPUT option for the dtDateTime parameter. Is that expected behaviour?
DEFINE VARIABLE dtDateTime AS DATETIME NO-UNDO. DEFINE VARIABLE lOk AS LOGICAL NO-UNDO. lOk = System.DateTime:TryParse("01.01.2016", dtDateTime) . MESSAGE "lOk" lOk SKIP "dtDateTime" dtDateTime VIEW-AS ALERT-BOX.
See the "Parameter passing syntax" entry in the doc. The parameter mode for methods (and constructors) is optional unless there is overloading involved.
Yes, that is expected. With OO, since we know what the signature of the method is, the caller does not have to specify all the parameter modes. If nothing is specified, we just make it match. Personally, I think this is dubious behavior. But this is in the mode of the AVM trying to be helpful :-)
See the "Parameter passing syntax" entry in the doc. The parameter mode for methods (and constructors) is optional unless there is overloading involved.
Yes, that is expected. With OO, since we know what the signature of the method is, the caller does not have to specify all the parameter modes. If nothing is specified, we just make it match. Personally, I think this is dubious behavior. But this is in the mode of the AVM trying to be helpful :-)
Yup. Thus my comment on dubious behavior.
Could this be an option for the strict compiler ?
I consider "input" as optional, but "input-output" and "output" as mandatory.
Others have encountered this behavior and also identified the current implementation as confusing. We have already added to the "strict compiler" feature backlog a new strict compiler option which would require parameter modes for procedures, functions, constructors and methods.