[NewsTechTip] cols 80 rows 66 portrait const RTCOL=80 const SHD=25 const FNT=univers pcopies 3 # Anchor demo constants # min 10 between anchors # except where otherwise specified const AN1=7 # anchor 1 row, min=6 for demo const AN2=20 # anchor 2 row # lv at least 18 betw 2 & 3 for demo const AN3=40 # anchor 3 row const AN4=55 # anchor 4 row, max=60 for demo const WT1=1 # anchor 1 box line weight const WT2=7 # anchor 1 box line weight const WT3=12 # anchor 1 box line weight const WT4=20 # anchor 1 box line weight # create text on page for demo merge "z_TextIn" # do prepage to embed anchors, set col/row variables const ANCHOR1="Ln Item" # anchor text merge "z_Prepage" if copy 1 text 1,66,{"Copy "+str(copy)+" plain"},courier,4 end if if copy 2,3 text 1,66,{"Copy "+str(copy)},courier,4 font "Customer Total",0,0,20,1,FNT,14,bold text "Customer Total",0,2,"size 14",FNT,14 box "Customer Total",20,-1,{RTCOL-22},4,WT1,irows 2::SHD 4,icols 10 20 30 40 50 font "SalesRep Total",0,0,20,1,FNT,18,italic text "SalesRep Total",0,2,"size 18",FNT,18,italic box "SalesRep Total",20,-1,{RTCOL-32},4,WT2,irows 2:WT2:SHD 4:WT2,icols 10:WT2 20:WT2 30:WT2 40:WT2 50:WT2 font "Territory Total",0,0,20,1,FNT,22 text "Territory Total",0,2,"size 22",FNT,22 box "Territory Total",20,-1,{RTCOL-42},4,WT3,irows 2:WT3:SHD 4:WT3,icols 10:WT3 20:WT3 30:WT3 font "Grand Total",0,0,20,1,FNT,26 text "Grand Total",0,2,"size 26",FNT,26 box "Grand Total",20,-1,{RTCOL-52},4,WT4,irows 2:WT4:SHD 4:WT4,icols 10:WT4 20:WT4 30:WT4 end if if copy 3 font "^Top1",0,1,{btm1col},{(btm1row-top1row)-1},cgtimes,8,italic,center erase "^Top1",0,0,5,1 erase "^Btm1",0,0,5,1 font "^Top2",0,1,{btm2col},{(btm2row-top2row)-1},univers,10,bold,right erase "^Top2",0,0,5,1 erase "^Btm2",0,0,5,1 text "^Top4",10,2,"REPLACEMENT TEXT FOR SECTION 4",univers,18 erase "^Top4",0,0,{btm4col+5},{(btm4row-top4row)} erase "^Btm4",0,0,5,1 # do section 3 'lines' const FONTL=cgtimes,10 const FONTH=univers,10,italic cmove 1,{top3row},RTCOL,{btm3row},2,{top3row} # cmove 1,{top3row},RTCOL,{btm3row},11,{top3row+2} box "Ln Item",-1,-1,70,{btm3row-top3row+1},1,irows 1.5::SHD,icols 5 15 26 34 42 50 58 const LROWS={btm3row-top3row-1} text "Ln Item",1,-1.5,"Anchored Section 3 B - using fixed positions",FNT,18,italic font "Ln Item",0,0,2,1,FONTH,center font "Ln Item",0,1,2,LROWS,FONTL,center font "Ln Item",5,0,9,1,FONTH font "Ln Item",5,1,9,LROWS,FONTL font "Ln Item",15,0,10,1,FONTH font "Ln Item",15,1,10,LROWS,FONTL font "Ln Item",26,0,7,1,FONTH,right font "Ln Item",26,1,7,LROWS,FONTL,right font "Ln Item",34,0,7,1,FONTH,right font "Ln Item",34,1,7,LROWS,FONTL,right font "Ln Item",42,0,7,1,FONTH,right font "Ln Item",42,1,7,LROWS,FONTL,right font "Ln Item",50,0,7,1,FONTH,right font "Ln Item",50,1,7,LROWS,FONTL,right font "Ln Item",58,0,11,1,FONTH,right font "Ln Item",58,1,11,LROWS,FONTL,right # note: if section 3 changes rows this # row or col range may need to change font "Serial No@15,20,35,40",0,0,40,1,FONTH,10,italic text "Serial No@15,20,35,40",-4,0.25,<42>,font 4141,symset 9J,14 text "}",2,0.25,<37>,font 4141,symset 9J,14 erase "}",0,0,1,1 end if [z_TextIn] const TXIN1=" Section 1 at page top Serial No xx " const TXIN2=" This is section 2 text under above " const TXIN4=" This is section 4 text at bottom " const TXIN3A ="Ln Item Desc OrQty ShQty BoQty Price Extension" const TXIN3B1="1 110-1 Widget 1 1 1 0 1.00 1.00" const TXIN3B2="2 110-2A Widget 2 2 2 0 2.00 4.00" const TXIN3B3="3 110-3 Widget 3 3 1 2 3.00 3.00" const TXIN3B4="4 110-4B Widget 4 4 4 0 4.00 16.00" const TXIN3B5="5 110-5 Widget 5 5 4 1 5.00 20.00" const TXIN3B6=" Serial No 89" const TXIN3B7="6 110-6CD Widget 6 6 6 0 6.00 36.00" const TXIN3B8="7 110-7 Widget 7 7 7 0 7.00 49.00" prepage { for row=4 to AN1-2;text$[row]=" TXIN1"+" TXIN1";next row text$[AN1] =fill(1) +"Customer Total" for row=AN1+7 to AN2-2;text$[row]=" TXIN2"+" TXIN2";next row text$[AN2]=fill(11)+"SalesRep Total" cnt=0 for row=AN2+7 to AN3-2 if cnt=0 text$[row]="TXIN3A" if cnt=1 text$[row]="TXIN3B1" if cnt=2 text$[row]="TXIN3B2" if cnt=3 text$[row]="TXIN3B3" if cnt=4 text$[row]="TXIN3B4" if cnt=5 text$[row]="TXIN3B5" if cnt=6 text$[row]=fill(15)+"TXIN3B6" if cnt=7 text$[row]="TXIN3B7" if cnt=8 text$[row]="TXIN3B8" cnt=cnt+1 next i text$[AN3]=fill(21)+"Territory Total" for row=AN3+7 to AN4-2;text$[row]=" TXIN4"+" TXIN4";next row text$[AN4]=fill(31)+"Grand Total" } [z_Prepage] # merge code prepage { # Embed some anchors for copy 3 enhancements text$[3]="^Top1",text$[AN1-1]=fill(75)+"^Btm1" text$[AN1+6]="^Top2",text$[AN2-1]=fill(75)+"^Btm2" text$[AN3+6]="^Top4",text$[AN4-1]=fill(75)+"^Btm4" anchortext$="Ln Item" # reset variables from last page top1col=0,top1row=0,btm1col=0,btm1row=0 top2col=0,top2row=0,btm2col=0,btm2row=0 top4col=0,top4row=0,btm4col=0,btm4row=0 top3col=0,top3row=0,btm3row=0 for i=row to 66 txt$=pad(text$[row],80) if top1col=0 top1col=pos("^Top1"=txt$); if top1col top1row=i if btm1col=0 btm1col=pos("^Btm1"=txt$); if btm1col btm1row=i if top2col=0 top2col=pos("^Top2"=txt$); if top2col top2row=i if btm2col=0 btm2col=pos("^Btm2"=txt$); if btm2col btm2row=i if top4col=0 top4col=pos("^Top4"=txt$); if top4col top4row=i if btm4col=0 btm4col=pos("^Btm4"=txt$); if btm4col btm4row=i # 'lines' section 3 if top3col=0 top3col=pos(anchortext$=txt$); if top3col top3row=i if (top3col>0 and btm3row=0 and trim(txt$)="") btm3row=i # flag back order for phone dingbat if (top3row>0 and i<>top3row and btm3row=0 and num(txt$(41,7),err=next)<>0) then text$[row](43,1)="}" next row }