Compile error when passing ? to a method with several overlo

Posted by jquerijero on 13-Jan-2011 17:00

When the method signatures looks like this;

Method(INPUT str AS CHARACTER, INPUT obj AS System.Object)

Method(INPUT str AS CHARACTER, INPUT obj AS System.Type)  - System.Type is derived from System.Object

Calling the method with the following parameters fails;

THIS-OBJECT:Method("sometext", ?).

NOTE: This type of call is very common with many .NET Framework static classes.

All Replies

Posted by Admin on 13-Jan-2011 17:06

DEFINE VARIABLE oObject AS System.Object NO-UNDO .

ASSIGN oObject = ? .

DEFINE VARIABLE oType AS System.Type NO-UNDO .

ASSIGN oType = ? .

And then

THIS-OBJECT:Method("sometext", oObject).

or

THIS-OBJECT:Method("sometext", oType).

Will resolve this case.

This thread is closed