Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to know the attributes names of an object at run-time?

10 views
Skip to first unread message

Juan Ignacio Saitua

unread,
Jan 15, 2001, 4:38:35 PM1/15/01
to
Is it possible to know, at run-time, the attributes names of an object (like
the reflection API in java)?
For example:
_________________________
cPerson:
string: name
string: direction
....
cPersona: aPerson
.....
reflection.getAttributes (aPersona): string[*] <-------so the array
has the values: string[1] = "name", string[2] = "direction"
_________________________


I tried using the CDK. It works OK when debugging the application, but not
for the *.EXE (..I know...it works only with the outline....).
Maybe some of the XSal(xxx) products?

Thanks.
Juan Ignacio Saitua.


Frank (ITG)

unread,
Jan 15, 2001, 5:39:04 PM1/15/01
to
AFAIK this is not possible as most (if not all) symbols
"loose" their name during the compile/build process.
During runtime you can (with some flaws) query the type
of symbols, but not their name as it was edited during design time.

--
Regards,
Frank Boettcher
Ice Tea Group, LLC
http://www.iceteagroup.com


"Juan Ignacio Saitua" <jisa...@cge.cl> schrieb im Newsbeitrag
news:eJFgkQz...@talkto.centurasoft.com...

Juan Ignacio Saitua

unread,
Jan 16, 2001, 9:35:56 AM1/16/01
to
Hi Frank,

But, what about the SalCompileAndEvaluate function?
For example look this program, that sets some attribute of an object at
run-time:
_____________________________________
Set aPerson = new cPersona
Set anyString = df1
set attName = df2
Set strExpression = 'Set aPerson.' || attName || '= anyString'
Set nType = SalCompileAndEvaluate ( strExpression, nError, nErrorPos,
nReturn, strReturn, dtReturn, hWndReturn, TRUE, SalContextCurrent() )
____________________________________

With this sample whe're setting at run-time any string attribute of a
cPersona object.
I think, that in some place there are the attribute-labels of cPerson: name,
direction, because the program 'knows' how to evaluate strExpression. If so,
would be possible to retrieve that info for the object?

Any comment about this?

Thank you!
Juan Ignacio Saitua.

Frank (ITG)

unread,
Jan 16, 2001, 5:00:45 PM1/16/01
to
Juan,

from a discussion with someone at CNTR I recall that this interface
is not exposed through the cdk. SalCompileAndEvaluate use
a name and scope to determine the corresponding HITEM (and the value).
AFAIK these internas have never been (and will never be?) exposed through
the CDK.
Of course this is just my guess.

Sorry,
Frank


"Juan Ignacio Saitua" <jisa...@cge.cl> schrieb im Newsbeitrag

news:gBKuuJ8...@talkto.centurasoft.com...

Juan Ignacio Saitua

unread,
Jan 17, 2001, 8:52:44 AM1/17/01
to
>AFAIK these internas have never been (and will never be?) exposed through

^^^^^^^^^^^^^
Any comment about this from the Oficial Centura Team? IMHO it would be an
interesting feature for the developers.....

Regards, and thank you Frank for the info.
Juan Ignacio Saitua.


0 new messages