Link to home
Start Free TrialLog in
Avatar of Helixir
Helixir

asked on

MSGCON and AFP

Is there any know solution to specify a position to a MSGCON in a PTRF with the AFP op-code POSITION(X,Y)  ?

when I compile my prtf it gives me an error wherever I put the MSGCON.

PS: Samething with DFT !!
Avatar of daveslater
daveslater
Flag of United States of America image

Hi  Helixir
I have had this problem and could not get it to work.
My understanding is you can only use the position keyword with fields and overlays.
My workround solution was:

make the field names in the DDS the message id's ie (note to make like easy in the RPG make all the field lengths the same- proessing can the be performed in an array

A          R @@HDR                                                
A            MSG0001       25          POSITION(12 10)            
A            MSG0002       25          POSITION(12 12)            
A            MSG1025       25          POSITION(12 13)            
A            MSG1027       25          POSITION(12 14)            
A            MSG1256       25          POSITION(12 15)            
A            MSG1035       25          POSITION(12 16)            

then in the RPG would look somthing like

 ** Api to get messages                                                                      
dRcv100           ds                                                                          
dByteRtn                  1      4b 0                                      Bytes Returned    
dByteAvl                  5      8b 0                                      Bytes Available    
dMsgLenRtn                9     12b 0                                      Length Of Msg. R  
dMsgLenAvl               13     16b 0                                      Length Of Msg. A  
dMsgData                 25    174                                         Actual Message    
 * Error Codes In Case of Error                                                              
dErrCode          ds            16                                                            
dByteProvide              1      4b 0 Inz(16)                              Byyes Provided    
dByteAvail                5      8b 0                                      Bytes Available    
dExcpText                 9     15                                         Exception Msg./T  
 **Parms for the API call                                                                    
dLenMsgInf        s              9b 0 Inz(%SIZE(MsgData))                  Message Length    
dFmtName          s              8    Inz('RTVM0100')                      Format name        
dMsgIdn           s              7                                         Message Id        
dMsgFile          s             20    Inz('MYMSGFILE *LIBL     ')          Message File      
dMesgData         s            130    Inz(*Blanks)                         Message            
dMesgLen          s              9b 0 Inz(130)                             Message Length    
dReplSubs         s             10    Inz('*NO')                           Replace Substitu  
dRtnFmtCC         s             10    Inz('*NO')                           Return Fmt.Contr  
 ** MAP DDS fields to array and set degfault values                                          
d fmt@@HDR        ds                                                                          
d MSG0001                             Inz('Initial value')                                    
d MSG0002                             Inz('Initial value')                                    
d MSG1025                             Inz('Initial value')                                    
d MSG1027                             Inz('Initial value')                                    
d MSG1256                             Inz('Initial value')                                    
d MSG1035                             Inz('Initial value')                                    
d txtary                              like(MSG0001) dim(6)                                    
D                                     Overlay(fmt@@HDR:1)                                    
 ** Msg Id's to override default values                                                      
d fmtHDRAry       s              7    Dim(6) Perrcd(1) CtData                                
 ** Wirk Fielsd                                                                              
d idx             s             10i 0                                                        
C                                                                                            
C                   FOR       IDX=1  TO %ELEM(fmtHDRAry)                                      
C                   CLEAR                   MsgData                                          
C                   reset                   ErrCode                                        
c                   Call      'QMHRTVM'                                                    
c                   Parm                    Rcv100                                          
c                   Parm                    LenMsgInf                                      
c                   Parm                    FmtName                                        
c                   Parm      fmtHDRAry(idx)MsgIdn                                          
c                   Parm                    MsgFile                                        
c                   Parm                    MesgData                                        
c                   Parm                    MesgLen                                        
c                   Parm                    ReplSubs                                        
c                   Parm                    RtnFmtCC                                        
c                   Parm                    ErrCode                                        
 ** If no error then message exists, so use the dext                                        
C                   IF        ByteAvail=0                                                  
C                   EVAL      TXTARY(IDX)=MsgData                                          
C                   ENDIF                                                                  
C                   ENDFOR                                                                  
C                                                                                          
C                   EVAL      *INLR=*ON                                                    
** Message array    
MSG0001              
MSG0002              
MSG1025              
MSG1027              
MSG1256              
MSG1035


Dave            

Avatar of Helixir
Helixir

ASKER

Thanks Dave,

My problem is that it for the Fax Cover, so I don't have RPG behind the printer file, I'll probably do a old fashionned record !! with no position !
Hi
another solution is to craete an overlay. This could then be positioned in the DDS.

Dave
Avatar of Helixir

ASKER

Hey, Last time I did overlays I was using the driver AFP240, but it doesn't seem to work with Office 2002, What driver are you using ??
ASKER CERTIFIED SOLUTION
Avatar of daveslater
daveslater
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Helixir

ASKER

Thanks Dave