Macro: DIRECT_OUTPUT
#IFSAME !1 CHANNEL
!A [] $10A |CI1 !2
#IF !0>2
DIRECT_OUTPUT !3 !4
#ENDIF
#ELSE
#IFSAME !1 DBMS IMAGE
#IFSAME !1 IMAGE
#IFDEF !2 // allow variable for image number
DIRECT_OUTPUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
#ELSE
#SET Q$ !2.N
!A [] $101 |CS"!1:!q"
#ENDIF
#ELSE
#IFCLASS !2 "F" // if field ref, use as is
!A [] $101 |CS"!1:!2"
#ELSE
#IFDEF !2 // for all classes/types, assume variable string for field ref
DIRECT_OUTPUT ('!1:' + string(!2)) !3 !4 !5 !6 !7 !8 !9
#ELSE
#CHECK !2 _U // force cannot be untyped error.
#ENDIF
#ENDIF
#ENDIF
#ELSE
#CHECK !2 .
!A [] $101 !1
#ENDIF
#ENDIF