Call class methods in .p using source-procedure

Posted by atuldalvi123 on 26-Apr-2016 03:17

I am calling a .p program from class and in that .p I am using source-procedure to assign a handle of that class.

Now using internal-entries I am able to get a list of methods in class program but not able to call the methods.

Dont know the exact syntax to call those methods.

All Replies

Posted by Mike Fechner on 26-Apr-2016 03:19

Through the RUN Statement. Like from a procedure.

Posted by atuldalvi123 on 26-Apr-2016 03:24

.

Posted by atuldalvi123 on 26-Apr-2016 04:47

I have modified information as above in the original post. Pls check.

Posted by Mike Fechner on 26-Apr-2016 04:55

You need to modify your code, so that the procedure receives a typed reference variable of the class as an input parameter. Then the procedure can use this input parameter and call into class methods.

In the Class:

RUN yourProcedure.p (THIS-OBJECT).

In the procedure:

DEFINE INPUT PARAMETER poObject as YourClass NO-UNDO .

poObject:SomeMethod ().

the fact that the SOURCE-PROCEDURE handle points to something for procedures invoked from a class was accidental and should not be relied on.

This thread is closed