Return to Symbol


Find the Nth Object with Given Name Example

This example demonstrates the use of the &ENAME EDA to find the third object with the name "SPOOL5" in order to change it to "SPOOL6".

$$
$$ Declarations
$$
ENTITY/E
E=&ENAME(3,'SPOOL5',IFERR,A1:)
&NAME(E)='SPOOL6'
A1:MESSG/'CANNOT FIND NAME'

In the next program, the first ten objects or the total number of objects, whichever is smaller, with the name LOCK_PIN will be deleted.

$$
$$ Declarations
$$
ENTITY/E(10)
DO/A1:,I,1,10
E(I)=&ENAME(I,'LOCK PIN',IFERR,A2:)
A1:
A2:
I=I-1
IF/I==0,JUMP/A3:
DELETE/E(1..I)
A3: