I have some PP Talk code that has been working quite well in harvesting Invoice PDF’s from an archive folder. I would like to make a modification to the code to insert a “C” in front of the variable that it goes looking for when the code finds Credit Return in the position indicated (the # is correct, but in the archive folder the actual credit is preceded by a C. I am including the code here as it currently stands. I would love to attach the data stream that the code works on, but I am not allowed to upload a file!!. Thanks in advance for your help.
define(&Date,string,‘’)
define(&DBD,integer,0)
define(&Data_Date,string,‘’)
define(&x,integer,0)
define(&pdf,string,‘’)
define(&totalPages,integer,0)
define(&pagePDF,integer,0)
for(&x,15,1,54)
if((trim(@(&x,24,30)) = ‘INVOICE’) or(trim(@(&x,24,36)) = ‘CREDIT RETURN’))
&Data_Date := @(&x,14,15) + @(&x,17,18) + ‘20’ + @(&x,20,21)
% show(&Data_Date)
&DBD := @DaysBetweenDates(&Data_Date,&Watch.JobInfos[9],‘MMDDYYYY’)
% &DBD := @DaysBetweenDates(&Data_Date,‘08102013’,‘MMDDYYYY’)
% show(’ +’ + inttostr(&DBD))
if((&DBD < 365) and (&DBD >= 0))
% show(&Data_Date + ’ ’ + inttostr(&DBD))
% show(‘C:\archive\’ + trim(@(&x,2,10)) + ‘.pdf’)
crlf()
if(pdfpagecount(‘C:\archive\’ + trim(@(&x,2,10)) + ‘.pdf’)>0)
&pdf := ‘C:\archive\’ + trim(@(&x,2,10)) + ‘.pdf’
&totalPages := pdfpagecount(&pdf)
for(&pagePDF,1,1,&totalPages)
showpdf(&pdf,&pagePDF,8.4,10.6)
showpage()
endfor()
elseif
&PrintPage := true
$NoPDF
showpage
&PrintPage := false
endif()
endif()
endif()
endfor()