by byron.hopp » Sat Apr 18, 2015 7:20 pm
Here is an example of the printout discussed earlier. I am using the method Say (Inchsay uses say it just converts Inches to Pixels before)
Source below:
Function TestAlign()
#Define PAD_LEFT 0
#Define PAD_RIGHT 1
#Define PAD_CENTER 2
Local oPrn
Local oBrush := nil
Local oFont := nil
Local oPen := nil
Local nTop := 200
Local nLeft := 200
Local nBottom := 285
Local nRight := 500
Local nCenter := nLeft + ( nRight - nLeft ) / 2
Local nWidth := nRight - nLeft
Local cCode := ""
Printer oPrn Preview
Define Font oFont Name "Arial" Size 0, -10 of oPrn
Define Pen oPen Width 05 Color CLR_BLACK of oPrn
Page
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nLeft,"WideText",oFont,,,,PAD_LEFT )
cCode := "oPrn:Say( nTop,nLeft,'WideText',oFont,,,,PAD_LEFT )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )
nTop += 100
nBottom += 100
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nRight,"WideText",oFont,,,,PAD_RIGHT )
oPrn:Say( nTop,nRight,"WideText",oFont,,,,PAD_RIGHT )
cCode := "oPrn:Say( nTop,nRight,'WideText',oFont,,,,PAD_RIGHT )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )
nTop += 100
nBottom += 100
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nCenter,'WideText',oFont,,,,PAD_CENTER )
cCode := "oPrn:Say( nTop,nCenter,'WideText',oFont,,,,PAD_CENTER )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )
nTop += 150
nBottom += 150
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nLeft,"WideText",oFont,nWidth,,,PAD_LEFT )
cCode := "oPrn:Say( nTop,nLeft,'WideText',oFont,nWidth,,,PAD_LEFT )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )
nTop += 100
nBottom += 100
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nRight,"WideText",oFont,nWidth,,,PAD_RIGHT )
cCode := "oPrn:Say( nTop,nRight,'WideText',oFont,nWidth,,,PAD_RIGHT )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )
nTop += 100
nBottom += 100
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nCenter,'WideText',oFont,nWidth,,,PAD_CENTER )
cCode := "oPrn:Say( nTop,nCenter,'WideText',oFont,nWidth,,,PAD_CENTER )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )
EndPage
EndPrint
Return nil