Calling DYNAMIC-FUNCTION like Dynamic(method name, source-pr

Posted by aren on 07-Aug-2017 18:56

Example:

Class A has method Test

source-procedure: Handle-A  which represents Class A file.

We use DYNAMIC-FUNCTION("Test" in Handle-A ) to call the method Test in Class A.

This always for us in 11.5, 11.6. But it does not work in 11.7 It will give an error: User-defined function 'Test' invoked dynamically but could not be found.

This is affecting our programs and causes that application hang. 

All Replies

Posted by Mike Fechner on 08-Aug-2017 06:50

Classes don't have functions. They have methods. You really should switch to INVOKE-METHOD.

Sent from Nine

Von: aren <bounce-aren@community.progress.com>
Gesendet: 08.08.2017 13:45
An: TU.OE.Development@community.progress.com
Betreff: [Technical Users - OE Development] Calling DYNAMIC-FUNCTION like Dynamic(method name, source-procedure of a class file) not work in 11.7

Update from Progress Community
aren

Example:

Class A has method Test

source-procedure: Handle-A  which represents Class A file.

We use DYNAMIC-FUNCTION("Test" in Handle-A ) to call the method Test in Class A.

This always for us in 11.5, 11.6. But it does not work in 11.7 It will give an error: User-defined function 'Test' invoked dynamically but could not be found.

This is affecting our programs and causes that application hang. 

View online

 

You received this notification because you subscribed to the forum.  To stop receiving updates from only this thread, go here.

Flag this post as spam/abuse.

Posted by marian.edu on 08-Aug-2017 06:58

Nothing wrong with your statements Mike, still if PSC somehow allowed a procedure handle (SOURCE-PROCEDURE) to point to a class instance and with that using DYNAMIC-FUNCTION was allowed then they would rather do something to keep that working for backward compatibility sake… we all know this is paramount here and bugs aren’t fixed because of it :)


It should still be spotted by the compiler and marked as error/warning depending on strict level.

Marian Edu

Acorn IT 
+40 740 036 212

Posted by marian.edu on 08-Aug-2017 06:58

Nothing wrong with your statements Mike, still if PSC somehow allowed a procedure handle (SOURCE-PROCEDURE) to point to a class instance and with that using DYNAMIC-FUNCTION was allowed then they would rather do something to keep that working for backward compatibility sake… we all know this is paramount here and bugs aren’t fixed because of it :)

It should still be spotted by the compiler and marked as error/warning depending on strict level.

Marian Edu

Acorn IT

www.acorn-it.com

www.akera.io

+40 740 036 212

Posted by Mike Fechner on 08-Aug-2017 07:02

There should not be backwards compatibility which would prevent fixing a bug! And this was certainly never documented as a feature!

Sent from Nine

Von: "marian.edu" <bounce-marianedu@community.progress.com>
Gesendet: 08.08.2017 13:59
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Calling DYNAMIC-FUNCTION like Dynamic(method name, source-procedure of a class file) not work in 11.7

Update from Progress Community
marian.edu

Nothing wrong with your statements Mike, still if PSC somehow allowed a procedure handle (SOURCE-PROCEDURE) to point to a class instance and with that using DYNAMIC-FUNCTION was allowed then they would rather do something to keep that working for backward compatibility sake… we all know this is paramount here and bugs aren’t fixed because of it :)


It should still be spotted by the compiler and marked as error/warning depending on strict level.

Marian Edu

Acorn IT 
+40 740 036 212

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

Posted by marian.edu on 08-Aug-2017 07:18

Agreed on both, was more a teaser than a real comment :)


Using undocumented “features” might force one to change the code and this is a perfect example - having source procedure pointing to a class instance is a bug and ought to be fixed. 

However,  PSC should probably have done more to get 4gl developers familiar with the basic OO concepts as those were introduced…

Marian Edu

Acorn IT 
+40 740 036 212

Posted by Laura Stern on 08-Aug-2017 07:45

As everyone has already said, if Test is a method in class A, not a function in a procedure, then using DYNAMIC-FUNCTION("Test" in Handle-A ) should NOT work  Don't know how it was working before - probably an accident.  You really need to use DYNAMIC-INVOKE instead, as Mike said.  We don't want to go back to making something work when it really makes no sense.  

This thread is closed