Hi,
I want to replace blrfarray of scom I tried using below code but not getting results.
VAR !B COLL ALL SCOM FOR CE
DO !C VALUES !B
$!C
!s = ARRAY()
!s = !!ce.BLRFARRAY
do !x values !s
$!x
!S1=!C.REPLACE('*-8-30', '_M30_8')
enddo
enddo
Hi,
I want to replace blrfarray of scom I tried using below code but not getting results.
VAR !B COLL ALL SCOM FOR CE
DO !C VALUES !B
$!C
!s = ARRAY()
!s = !!ce.BLRFARRAY
do !x values !s
$!x
!S1=!C.REPLACE('*-8-30', '_M30_8')
enddo
enddo
!SCOMS = !!COLLECTALLFOR(|SCOM|,||,!!CE)
DO !SCOM VALUES !SCOMS
$!SCOM
!s = !SCOM.BLRFARRAY[1]
$!S
!S1 = !!CE.NAME.REPLACE('-8-30', '_M30_8')
NAME $!S1
ENDDO
SAME
Thanks for reply Deva, but I want to change scom BLRFARRAY attribute for scom both btse are already available.
!SCOMS = !!COLLECTALLFOR(|SCOM|,||,!!CE)
DO !SCOM VALUES !SCOMS
$!SCOM
!A = BLRFARRAY
DO !I FROM 1 TO !A.SIZE()
$!A[$!I]
!S1 = !A.NAME.REPLACE('-8-', '-M8-')
NAME $!S1
ENDDO
ENDDO
I wanted to change boltset of scom with different something like this .
!SCOMS = !!COLLECTALLFOR(|SCOM|,||,!!CE)
DO !SCOM VALUES !SCOMS
$!SCOM
!A = BLRFARRAY
DO !I FROM 1 TO !A.SIZE()
$!A[$!I]
!S1 = !A.BLRFARRAY[1].REPLACE('/AEFTAD01-4-14', '/AEFTAD01_M30_8')
BLRFARRAY $!S1
ENDDO
ENDDO
but showing error (2,759) Object does not have a member
BLRFARRAY
develop a form with provision of different bolt reference values, this will help if the changes are not limited to one or two name replacements.
Variable !A already picking BLRFARRAY in the fourth line of code. !A[1] is first element of BLRFARRAY
Replace option will be available to strings not arrays.
will fix tomorrow.
yes that is where I stuck tto convert array
you may check the following code. you may add handle if the New Reference does not exist.
I was using the code above as my starting point.
!SCOMS = !!COLLECTALLFOR(|SCOM|,||,!!CE) DO !SCOM VALUES !SCOMS !A = !SCOM.BLRFARRAY !arrUpdateBlrfarray = object array() DO !refBTSE values !A if !refBTSE eq /AEFTAD01-4-14 then !refBTSEUpdate = /AEFTAD01_M30_8 else !refBTSEUpdate = !refBTSE endif !arrUpdateBlrfarray.append(!refBTSEUpdate) ENDDO !SCOM.blrfarray = !arrUpdateBlrfarray ENDDO
!SCOMS = !!COLLECTALLFOR(|SCOM|,||,!!CE)
DO !SCOM VALUES !SCOMS
$!SCOM
!A = BLRFARRAY
DO !I FROM 1 TO !A.SIZE()
$!A[$!I]
!S1 = !!CE.NAMN.REPLACE('AEFTAD0-4-14', 'AEFTAD01_M30_8')
Q VAR !S1
NAME /$!S1
ENDDO
ENDDO