procedure d'affichage (appel WRKMAILC2/C3)

BoTTom |
     Fwrkmaild  cf   e             workstn sfile(fe:rang)
     Fdstin     if   e             disk
     Fdstdoc    if   e             disk    usropn
 
     Drang             s              4  0
     Ddejavu           s              1
     Dindex            s                   like(rcvdl)
     Ddata             s                   like(rcvdta)
     Ddebut            S              9B 0
     Dfin              S              9B 0
     Dmarque           S              2A   inz(x'0D25')
     Dtemp             S            256A
 
     C     *entry        plist
     C     *in06         parm      *in06         ind06             1
 
     c                   if        dejavu <> '1'
      * première fois
     c                   eval      dejavu =  '1'
     c                   write     titre
     c                   exsr      mabsfl
     c                   read      dstin                                  90
 
     c                   if        *in90 = *off
      * chargement sfl
     c                   dou       *in90 = *on
     c                   eval      rang = rang + 1
     c                   eval      typ = ' '
     c                   if        lindtp = 0
     c                   eval      typ = 'Msg'
     c                   else
     c                   eval      typ = 'Doc'
     c                   endif
     c                   write     fe
     c                   read      dstin                                  90
     c                   enddo
      * préparation affichage
     c                   eval      *in30 = *on
     c                   endif
      * fin première fois
     c                   endif
 
     c                   if        *in30 = *on
     c                   exsr      trt


|
     c                   else
     c                   write     vide
     c                   exfmt     fc
     c                   endif
     c                   return
 
 
     c     trt           begsr
     c                   write     pied
     c                   exfmt     fc
     c                   dow       *in03 = *off and *in06 = *off
     c                   exsr      lectur
     c                   exfmt     fc
     c                   enddo
     c                   endsr
 
 
     c     lectur        begsr
     c                   readc     fe                                     91
     c                   dow       *in91 = *off
     c                   if        option <> ' '
     c                   if        option = '5'
     c                   if        typ = 'Msg'
     c                   exfmt     win03
     c                   else
     c                   exsr      trtdoc
     c                   exfmt     win04
     c                   endif
     c                   else
     c                   callb     'WRKMAILC2'
     c                   parm                    lindid
     c                   parm                    option
     c                   if        option = '4'
     c                   eval      linsui = ' *dlt'
     c                   eval      linsua = ' '
     c                   endif
     c                   endif
     c                   eval      option = ' '
     c                   update    fe
     c                   endif
     c                   readc     fe                                     91
     c                   enddo
     c                   endsr
 


|
 
     c     mabsfl        begsr
     c                   eval      *in30 = *off
     c                   eval      *in31 = *off
     c                   write     fc
     c                   eval      *in31 = *on
     c                   endsr
 
 
     c     trtdoc        begsr
     c                   callb     'WRKMAILC3'
     c                   parm                    lindid
     c                   open      dstdoc
     c                   read      dstdoc                                 95
     c                   close     dstdoc
 
 
     c                   eval      data = rcvdta
     c                   do        rcvdl         index
     c                   if        %subst(data:index:1) < ' '
     c                   eval      %subst(data:index:1) = ' '
     c                   endif
     c                   enddo
     c
     C                   eval      debut = %scan('From:' : rcvdta: 1)
     C                   eval      debut = debut + 5
     C                   eval      fin = %scan(marque : rcvdta: debut)
     C                   if        fin > debut
     c                   eval      temp = %subst(data: debut :
     c                                           fin - debut )
     C                   endif
     c                   movel     temp          from
      *
     C                   eval      debut = %scan('To:' : rcvdta : fin)
     C                   eval      debut = debut + 3
     C                   eval      fin = %scan(marque : rcvdta: debut)
     C                   if        fin > debut
     c                   eval      temp = %subst(data: debut:
     c                                           fin - debut )
     C                   endif
     c                   movel     temp          to
      *
     C                   eval      debut = %scan('Date:' : rcvdta: fin)
     C                   eval      debut = debut + 5


|
     C                   eval      fin = %scan(marque: rcvdta : debut)
     C                   if        fin > debut
     c                   eval      temp = %subst(data: debut :
     c                                           fin - debut )
     C                   endif
     c                   movel     temp          date
      *
     C                   eval      debut = %scan('Subject:' : rcvdta: fin)
     C                   eval      debut = debut + 8
     C                   eval      fin = %scan(marque: rcvdta : debut)
     C                   if        fin > debut
     c                   eval      temp = %subst(data: debut :
     c                                           fin - debut )
     C                   endif
     c                   movel     temp          subject
      *
     C                   eval      debut = fin + 1
     C                   eval      fin = %size(rcvdta)
     C                   if        fin - debut < 256
     c                   eval      temp = %subst(data: debut :
     c                                           fin - debut )
     c                   else
     c                   eval      temp = %subst(data: debut : 256)
     C                   endif
     c                   movel     temp          message
 
     c                   endsr




©AF400