Diff b/w.... [message #81956] |
Thu, 03 April 2003 22:04 |
Vinayak Awasthi
Messages: 19 Registered: October 2001
|
Junior Member |
|
|
Hi All,
what is the diff. b/w direct referencing & indirect referencing (i.e. COPY built - in/NAME_IN built in) .....and why indirect referencing is often suggested or used.....
vinayak
|
|
|
Re: Diff b/w.... [message #81983 is a reply to message #81956] |
Mon, 07 April 2003 10:18 |
sameer_am2002
Messages: 129 Registered: September 2002
|
Senior Member |
|
|
There are number of reasons one is to use item names dynamically by storing them in variables.Secondly u cannot use direct referencing in forms attached libraries.
|
|
|
Re: Diff b/w.... [message #81998 is a reply to message #81956] |
Tue, 08 April 2003 10:02 |
shadow
Messages: 15 Registered: April 2003
|
Junior Member |
|
|
I hope help this topic
Reddi -- Thanks for the question regarding "name_in and copy", version forms 6i
originally submitted on 12-May-2001 13:00 Eastern US time, last updated 1-Feb-2003 9:35
--------------------------------------------------------------------------------
You Asked
Tom
I have used name_in and copy commands very recently. But I am not very clear
about them. Can you explain to me what is there importance and utility.
Kindly give an example. I read that it helps avoiding hard coded values and
promote indirect referncing, can I know how. Please give an example in your
typical simple style.
Reddi
--------------------------------------------------------------------------------
and we said...
they allow you to indirectly reference a variable at run time.
Normally, you have to say:
if ( some_variable = 5 )
then
some_other_variable = 10;
end if;
the variables you are working on are known at compile time and will never
change. At runtime, it is sometimes useful to make this more generic. For
example -- you might have 10 blocks each of which have a item X and Y on them.
You could write a routine:
variable_name = :system.current_block || '.x';
if ( name_in( variable_name ) = 5 )
then
copy( :system.current_block || '.y', 10 );
end if;
That performs an operation on the X and Y of the current block -- instead of
having to have:
if ( :system.current_block = 'b1' )
then
if ( :b1.x = 5 )
then
:b1.y = 10;
end if;
elsif ( :system.current_block = 'b2' )
then
if ( :b2.x = 5 )
then
..............
|
|
|