Is there a safe way to detect functions or non-void method in the current stack?
I need a secure way to know if I can run a WAIT-FOR statement or not. In the past, some people had the strategy to loop thru PROGRAM-NAME (), but with classes that won't work: The same method name might return void and something else (thus being considered a function).
I need a way to get around the infamous "Input blocking statement is invalid while executing a user-defined function or method (2780)."
Even with structured error handling, I see no way of handling this message. Is that a bug or a feature?
but with classes that won't work: The same method name might return void and something else (thus being considered a function).
You can't overload methods by return type, so that's moot. Or am I missing something (again )?
-- peter
pjudge schrieb:
but with classes that won't work: The same method name might return void and something else (thus being considered a function).You can't overload methods by return type, so that's moot. Or am I missing something (again )?
-- peter
How about changing the return type + the parameters:
CLASS test :
METHOD PUBLIC VOID foo ().
END METHOD.
METHOD PUBLIC LOGICAL foo (p1 AS CHAR):
END METHOD .
END CLASS.
This class compiles (at least in 10.2A01).
How about changing the return type + the parameters:
CLASS test :
METHOD PUBLIC VOID foo ().
END METHOD.
METHOD PUBLIC LOGICAL foo (p1 AS CHAR):
END METHOD .
END CLASS.
This class compiles (at least in 10.2A01).
Interesting.
The Getting Started with OO doc, on page 3-14, doesn't mention changing the return type as part of its overloading criteria: it does mention # of params, and param types.
-- peter
Interesting.
The Getting Started with OO doc, on page 3-14, doesn't mention changing the return type as part of its overloading criteria: it does mention # of params, and param types.
-- peter
I feel sorry if I got you reading the docs...
I did change the number and types or parameters - and yes, that's a requirement. You can't change the return type on it's own.
I believe in that case the runtime wouldn't know what to execute for
foo() .
(if there would be a VOID and an INTEGER return type version of foo, all with no parameters).
Note: I di not use the method in an assignment be purpose.