!PipesFile = OBJECT FILE(|C:\temp\FMCValveReport.csv|)
!PipesFile.open(|OVERWRITE|)
!PipesFile.WriteRecord(|SITE,PIPE,UPSTREAM FLANGE,UPSTREAM GASKET,VALVE,DOWNSTREAM FLANGE,DOWNSTREAM GASKET|)
$Pcollecting Pipes
!pipe = !!collectallfor('VALV', 'PURP OF SITE EQ |PIPE| AND MATCHW(:CMCode OF SPREF, |FCAY4(N)*|)', World)
!pipe.appendarray(!!collectallfor('VALV', 'PURP OF SITE EQ |PIPE| AND MATCHW(:CMCode OF SPREF, |GCAX4(N)*|)', World))
!pipe.appendarray(!!collectallfor('VALV', 'PURP OF SITE EQ |PIPE| AND MATCHW(:CMCode OF SPREF, |GCAY4(N)*|)', World))
do !I values !pipe
$!I
-- Misc. fields
!Sit = name of SITE of $!I
-- Component
!Nam = :CMCODE of SPREF of $!I
!Pip = name of pipe of $!I
!UpFlange = :CMCODE of SPREF of PREV FLAN of $!I
handle(2,113)
--no flanges on upstream
!UpFlange = |No Upstream Flange|
endhandle
!UpGasket = :CMCODE of SPREF of PREV GASK of $!I
handle(2,113)
--no gasket on upstream
!UpGasket = |No Upstream Gasket|
endhandle
!DownFlange = :CMCODE of SPREF of NEXT FLAN of $!I
handle(2,113)
--no flanges on downstream
!DownFlange = |No Downstream Flange|
endhandle
!DownGasket = :CMCODE of SPREF of NEXT GASK of $!I
handle(2,113)
--no flanges on downstream
!DownGasket = |No Downstream Gasket|
endhandle
$* Output line
!PipesFile.WriteRecord(|$!Sit,$!Pip,$!UpFlange,$!UpGasket,$!Nam,$!DownFlange,$!DownGasket|)
enddo
!PipesFile.close()
thanks for suggestion