pascalpolverini.com
... only what can be explained is truly understood
modernisation apps sample code
:: iSeries modernisation sample code
in blue background: the relevant original source code
Everything else is the automatically converted/added code towards the new communication channel (procedures with service pgm)
RPG source sample automated conversion
See full RPG source before :: See full RPG source after FORDENTD CF E WORKSTN SFILE(ORDSFL:SFLRRN) F usropn … C if not iweb C EXFMT ORDCTL C else C eval iwebHiLoEq = ' ' C callp IWexORDCTL C endif … *===================================================================== PIWexORDCTL b DIWexORDCTL pi C if IWstORDENTD = 'open ' C callp IWwrORDCTL C callp IWrdORDCTL C endif C return PIWexORDCTL e *===================================================================== PIWwrORDCTL b DIWwrORDCTL pi C if IWstORDENTD = 'open ' C eval IWcdORDENTD = 'write ' C movea *in iwebind C eval iwebboolean = iwebtestind(iwebind: C '41') C if iwebboolean C eval IWvkORDENTD = IWfxORDCTL C endif C eval iwebdata = ' ' C callp putVarInd(iwebdata: C '*IN40':*IN40) … C movel CUSTOMER iwebc32767 C callp putVarChar(iwebdata: C 'CUSTOMER':iwebc32767:30) … C eval iwebn309 = PARTQTY C callp putVarNum(iwebdata: C 'PARTQTY':iwebn309: 5: 0: C 'edtcde': C 'Z') C eval IWrrORDSFL = 0 C eval iweber = iwebWrite(iwebdata:iwebjob: C IWfxORDCTL:0:iwebboolean:'output') C if iwebIndEr(iwebHiLoEq:iwebn2:iwebc2) C eval iwebboolean = iweber C callp IWsetInd C endif C callp IWbifERROR C movea *in iwebind C eval iweber = iwebSFLCLR(iwebjob: C IWfxORDSFL:IWfxORDCTL:iwebind: C '44') C eval IWfrW00660006 = ' ' C if iweblastdspo <> 'ORDENTD ' C eval IWfrF = *blank C endif C movea *in iwebind C eval IWfrF = iwebFramCyc(IWfrF: C 'SFLCTL': C 'ORDCTL':7:13:iwebind: C '*on ': C 'SFL': C 'ORDSFL':14:21: C '40') C if %scan('IWfrF':iwebFrameWrt) = 0 C eval iwebFrameWrt = %trim(iwebFrameWrt)+' ' C + 'IWfrF' C eval iwebFrameWrt = %trim(iwebFrameWrt) C endif C if iwebChkFmtCyc(iwebprevcycle:IWfrF ) C movea *in iwebind C eval iweber = iwebERRMSG(iwebjob:IWfxORDCTL: C 'Part number not found. ': C iwebind: C '81') C endif C eval iwebprevcycle = IWfrF C callp iwebCLRLrmv('ORDCTL':iwebc300) C eval IWfmORDENTD = 'ORDCTL ' C eval iweblastfmti = IWfmORDENTD C eval iweblastdspo = 'ORDENTD ' C endif C return PIWwrORDCTL e … *===================================================================== PIWrdORDCTL b DIWrdORDCTL pi C if IWstORDENTD = 'open ' C if IWcdORDENTD = 'write ' C eval iwebaction = 'output' C eval iwebaction = iwebOI(iwebjob: C iwebuser:'80':'1':'1': C '24':'80':IWvkORDENTD:IWfrF: C iwebsys:iwebaction:iwebcmd: C iwebCsr:iwebCsrRow:iwebproLib:iwebcurLib: C iwebc300) C eval iwebFrameWrt = ' ' C callp IWactionCmd C endif C eval iwebdata = iwebRead(iwebjob:IWfxORDCTL: C iweber:iwebeof) C if iweber = *off and iwebeof = *off C eval *IN03 = getVarInd(iwebdata: C '*IN03':*IN03) … C movel PARTNBR iwebc32767 C eval iwebc32767 = getVarChar(iwebdata: C 'PARTNBR':iwebc32767) C movel iwebc32767 PARTNBR C eval iwebn309 = PARTQTY C eval PARTQTY = getVarNum(iwebdata: C 'PARTQTY':iwebn309) C endif C if iwebIndEr(iwebHiLoEq:iwebn2:iwebc2) C eval iwebboolean = iweber C callp IWsetInd C endif C callp IWbifERROR C if iwebIndEof(iwebHiLoEq:iwebn2:iwebc2) C eval iwebboolean = iwebeof C callp IWsetInd C endif C eval IWcdORDENTD = 'read ' C endif C return PIWrdORDCTL e |
CLP source
|
DSPF
<?xml version="1.0" encoding="ISO-8859-1" ?> - <fmt name="ALTORDER" lib="ORDLIB" dsp="ORDENTD" typ="NORMAL" win="Y" mod="80" reca="" posX="00004" posY="00010" sizX="00066" sizY="00006" msizX="00066" msizY="00006" topY="00001" botY="00005"> - <fmtAtrs> <fmtAtr id="a000000001" event="CompTime" cond="" funct="TEXT">Change Order</fmtAtr> <fmtAtr id="a000000002" event="Window" cond="" funct="WINDOW">10 4 6 66</fmtAtr> <fmtAtr id="a100000002" event="Fkey" cond="" funct="CA04">04</fmtAtr> <fmtAtr id="a100000003" event="Fkey" cond="" funct="CA12">12</fmtAtr> <fmtAtr id="a100000004" event="Fkey" cond="" funct="CA16">16</fmtAtr> <fmtAtr id="a100000005" event="Fkey" cond="" funct="HELP" /> </fmtAtrs> - <flds> <fld name="*IN04" typ="*ind" cn="" use="I" dec="00" posX="00000" posY="00000" sizX="00000" sizY="00000" msizX="00000" msizY="00000" class="" unit="" cond="" /> <fld name="*IN12" typ="*ind" cn="" use="I" dec="00" posX="00000" posY="00000" sizX="00000" sizY="00000" msizX="00000" msizY="00000" class="" unit="" cond="" /> <fld name="*IN16" typ="*ind" cn="" use="I" dec="00" posX="00000" posY="00000" sizX="00000" sizY="00000" msizX="00000" msizY="00000" class="" unit="" cond="" /> <fld name="*IN81" typ="*ind" cn="" use="O" dec="00" posX="00000" posY="00000" sizX="00000" sizY="00000" msizX="00000" msizY="00000" class="" unit="" cond="" /> <fld name="*IN82" typ="*ind" cn="" use="O" dec="00" posX="00000" posY="00000" sizX="00000" sizY="00000" msizX="00000" msizY="00000" class="" unit="" cond="" /> <fld name="*IN83" typ="*ind" cn="" use="O" dec="00" posX="00000" posY="00000" sizX="00000" sizY="00000" msizX="00000" msizY="00000" class="" unit="" cond="" /> <fld name="*IN84" typ="*ind" cn="" use="O" dec="00" posX="00000" posY="00000" sizX="00000" sizY="00000" msizX="00000" msizY="00000" class="" unit="" cond="" /> - <fld name="c001024" typ="const" cn="" use="O" dec="00" posX="00024" posY="00001" sizX="00021" sizY="00001" msizX="00021" msizY="00001" class="title" unit="char" cond=""> - <fldAtrs> <fldAtr id="a000000001" event="FieldVal" cond="" funct="DFT">'Change Selected Order'</fldAtr> <fldAtr id="a000000002" event="Appearance" cond="" funct="DSPATR">HI</fldAtr> </fldAtrs> </fld> - <fld name="PARTNBR" typ="A" cn="c" use="B" dec="00" posX="00001" posY="00003" sizX="00006" sizY="00001" msizX="00006" msizY="00001" class="" unit="char" cond=""> - <fldAtrs> <fldAtr id="a000000001" event="CompTime" cond="" funct="REFFLD">IID *LIBL/ITEM</fldAtr> <fldAtr id="a000000002" event="Message" cond="81" funct="ERRMSG">'Part number not found.'</fldAtr> <fldAtr id="a000000003" event="Message" cond="84" funct="ERRMSG">'Part and quantity must be supplied.'</fldAtr> <fldAtr id="a001000001" event="CompTime" cond="" funct="TEXT">Item ID</fldAtr> </fldAtrs> </fld> - <fld name="PARTDSC" typ="A" cn="c" use="O" dec="00" posX="00009" posY="00003" sizX="00024" sizY="00001" msizX="00024" msizY="00001" class="FKey" unit="char" cond=""> - <fldAtrs> <fldAtr id="a000000001" event="CompTime" cond="" funct="REFFLD">INAME *LIBL/ITEM</fldAtr> <fldAtr id="a001000001" event="CompTime" cond="" funct="TEXT">Item Name</fldAtr> </fldAtrs> </fld> - <fld name="PARTQTY" typ="S" cn="n" use="B" dec="00" posX="00062" posY="00003" sizX="00005" sizY="00001" msizX="00005" msizY="00001" class="" unit="char" mKsizX="00005" cond=""> - <fldAtrs> <fldAtr id="a000000001" event="CompTime" cond="" funct="REFFLD">STQTY *LIBL/STOCK</fldAtr> <fldAtr id="a000000002" event="Message" cond="82" funct="ERRMSG">'No stock record found.'</fldAtr> <fldAtr id="a000000003" event="Message" cond="83" funct="ERRMSG">'Quantity greater than stock on hand.'</fldAtr> <fldAtr id="a000000004" event="Message" cond="84" funct="ERRMSG">'Part and quantity must be supplied.'</fldAtr> <fldAtr id="a000000005" event="Appearance" cond="" funct="EDTCDE">Z</fldAtr> <fldAtr id="a001000001" event="CompTime" cond="" funct="TEXT">Quantity on hand</fldAtr> </fldAtrs> </fld> - <fld name="c005001" typ="const" cn="" use="O" dec="00" posX="00001" posY="00005" sizX="00022" sizY="00001" msizX="00022" msizY="00001" class="FKey" unit="char" cond=""> - <fldAtrs> <fldAtr id="a000000001" event="FieldVal" cond="" funct="DFT">'F4=Prompt F12=Cancel'</fldAtr> <fldAtr id="a000000002" event="Appearance" cond="" funct="COLOR">BLU</fldAtr> </fldAtrs> </fld> </flds> </fmt> |