EDAboard.com | EDAboard.eu | EDAboard.de | EDAboard.co.uk | RTV forum PL | NewsGroups PL

ho to get an object knowing the dbId

elektroda.net NewsGroups Forum Index - Cadence - ho to get an object knowing the dbId

Marcel Preda
Guest

Tue Jul 06, 2010 1:25 pm   



Hi there,

I have a string which represents an object Id.
E.g. myVar = "db:0x5eb50da6"

How can I acces something like dbId(myVar)->myProperty ?


The background:
I have a report field form, and in one column I have to make a
reference to some shapes.
When user clicks on a row I want to highlight the associated shape.
The problem with the report field is that I can use as types only
integers, floats or strings - no something like dbId is allowed.
So I decide to put there the dbIds as strings in a column of the field
report.

Of course I can build a global hash with the dbIds as keys and the
associated object as value,
but I already have some global vars and I don't like it too much, I
would like to avoid creation of a new global var.

Thank you,
Marcel

Andrew Beckett
Guest

Fri Jul 09, 2010 6:56 pm   



Marcel Preda wrote, on 07/06/10 11:25:
Quote:
Hi there,

I have a string which represents an object Id.
E.g. myVar = "db:0x5eb50da6"

How can I acces something like dbId(myVar)->myProperty ?


The background:
I have a report field form, and in one column I have to make a
reference to some shapes.
When user clicks on a row I want to highlight the associated shape.
The problem with the report field is that I can use as types only
integers, floats or strings - no something like dbId is allowed.
So I decide to put there the dbIds as strings in a column of the field
report.

Of course I can build a global hash with the dbIds as keys and the
associated object as value,
but I already have some global vars and I don't like it too much, I
would like to avoid creation of a new global var.

Thank you,
Marcel

Hi Marcel,

The simple answer is you can't. You should not rely on dbId (especially by name)
because they are not consistent from one session to the next.

Even storing dbIds in data structures is a little risky, because the user could
do stuff in the meantime which makes them invalid (e.g. they could delete them)
and it is possible for dbIds to get reused in some cases.

However, you could create a hash to look them up some how. The hash (using
makeTable) does not need to be stored in a global variable; it could be stored
as a property on the form you're creating.

Best Regards,

Andrew.

elektroda.net NewsGroups Forum Index - Cadence - ho to get an object knowing the dbId

Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
RTV map EDAboard.com map News map EDAboard.eu map EDAboard.de map EDAboard.co.uk map Opony