Getting the extent of a dynamic property.

Posted by RWEBSTER on 02-Oct-2014 06:41

Is it possible to tell the extent of an object property when dealing with the object dynamically?

extent(dynamic-property(Object1,"foo").


Gives me an error '** Unknown Field or Variable name - extent. (201). Has anyone had luck with this before?

Posted by Ken McIntosh on 02-Oct-2014 06:51

Hi Ross,

This would be a nice feature, but I don't know whether it's expected to work or not.  What I can tell you is that the following works:

DEFINE VARIABLE oFoo AS foo   NO-UNDO.

DEFINE VARIABLE cBar AS CHARACTER   NO-UNDO EXTENT.

oFoo = NEW foo().

cBar = DYNAMIC-PROPERTY(oFoo,"cPropBar").

MESSAGE EXTENT(cBar)

   VIEW-AS ALERT-BOX INFO BUTTONS OK.

You can fetch the property into an indeterminate array and this automatically fixes the extents to match the property.

Regards,

Ken Mc

All Replies

Posted by jmls on 02-Oct-2014 06:51

From my android ide..

Dynamic-property(foo):extent

?

[collapse]
On 2 Oct 2014 12:42, "RWEBSTER" <bounce-stigdarkstar@community.progress.com> wrote:
Thread created by RWEBSTER

Is it possible to tell the extent of an object property when dealing with the object dynamically?

extent(dynamic-property(Object1,"foo").


Gives me an error '** Unknown Field or Variable name - extent. (201). Has anyone had luck with this before?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Ken McIntosh on 02-Oct-2014 06:51

Hi Ross,

This would be a nice feature, but I don't know whether it's expected to work or not.  What I can tell you is that the following works:

DEFINE VARIABLE oFoo AS foo   NO-UNDO.

DEFINE VARIABLE cBar AS CHARACTER   NO-UNDO EXTENT.

oFoo = NEW foo().

cBar = DYNAMIC-PROPERTY(oFoo,"cPropBar").

MESSAGE EXTENT(cBar)

   VIEW-AS ALERT-BOX INFO BUTTONS OK.

You can fetch the property into an indeterminate array and this automatically fixes the extents to match the property.

Regards,

Ken Mc

Posted by Mike Fechner on 02-Oct-2014 06:53

Did you try to assign the result of the dynamic-property to a variable with no fixed extent size and query the extent of that variable?

Posted by RWEBSTER on 02-Oct-2014 07:01

Julian; ha that's exactly what I tried next, (to no avail)

Ken, Mike, Thanks, that worked perfectly!

This thread is closed