Although I have created a routine to create this border every once in a while I have a strange incident.
The border contains of the following:
- corners (upper left, lower left, upper right, lower right)
- vertical lines
- horizontal lines
The problem I run into is that every once in while both the horizontal and vertical lines are repositioned by 2 cm's. The vertical lines move 2cm's to the right and the horizontal lines move 2cm's down.
I have adjusted the routine several times to change the sequence of things (lines first, corners next, etc) but until now I have not been able to solve the puzzle why this is happening at all. As the off-set is always 2cm I have the impression that a 'default' value (of something) is interfering with my code.
What is even more strange is that this repositioning ONLY happens for the hashed border lines...the corners do not show this and neither do any of the other objects that are placed on the label.
Although this behavior seems random there seems to be pattern in it. If I generate the same label multiple times than the first one is usually wrong...but the second one is always right.
Does anyone have a thought on why this might be happening?
PS I'm using VFP8 for the source and VPE3.5Enterprise Edition to generate the document.
- Code: Select all
print_hash('H', 60, 30, 90, tmpLabelLines.lnEndY) && Horizontal, lnEndY
print_hash('V', 60, 30, 90, tmpLabelLines.lnEndY) && Vertical
PROCEDURE print_hash(vDirection as Character, nHashWidth as integer, nHashHeight as integer, nDistance as integer, nHashTop as Integer)
PRIVATE oPolygon
PRIVATE nHashCounter = 0
oPolygon = ''
nHashCounter = 0
poform.lovpe.tovpe.olevpe.setdefoutrect(-200, -200, tmpLabelDef.LDwidth, tmpLabelDef.LDlength)
poform.lovpe.tovpe.olevpe.setoutrect(-200, -200, tmpLabelDef.LDwidth, tmpLabelDef.LDlength)
IF vDirection = 'H'
FOR nTeller = tmpLabelLines.lnBeginX TO tmpLabelLines.lnEndX STEP nDistance
xTeller = nTeller
poform.lovpe.tovpe.olevpe.BkgMode = VBKG_SOLID
poform.lovpe.tovpe.olevpe.BkgColor = color_black
poform.lovpe.tovpe.olevpe.pensize = 1
oPolygon=poform.lovpe.tovpe.olevpe.Polygon(4)
poform.lovpe.tovpe.olevpe.AddPolygonPoint(oPolygon, -200 + tmpLabelLines.lnBeginX + nHashCounter * nDistance , nHashTop - nHashHeight + labellines.lnBeginY)
poform.lovpe.tovpe.olevpe.AddPolygonPoint(oPolygon, -200 + tmpLabelLines.lnBeginX + nHashCounter * nDistance + nHashWidth , nHashTop - nHashHeight + labellines.lnBeginY)
poform.lovpe.tovpe.olevpe.AddPolygonPoint(oPolygon, -200 + tmpLabelLines.lnBeginX + nHashCounter * nDistance + nHashWidth + nHashWidth/2 , nHashTop + labellines.lnBeginY)
poform.lovpe.tovpe.olevpe.AddPolygonPoint(oPolygon, -200 + tmpLabelLines.lnBeginX + nHashCounter * nDistance + nHashWidth/2 , nHashTop + labellines.lnBeginY)
nHashCounter = nHashCounter + 1
ENDFOR
poform.lovpe.tovpe.olevpe.pensize = 0
ELSE
poform.lovpe.tovpe.olevpe.BkgMode = VBKG_SOLID
poform.lovpe.tovpe.olevpe.BkgColor = color_black
poform.lovpe.tovpe.olevpe.pensize = 1
FOR nTeller = tmpLabelLines.lnBeginX TO tmpLabelLines.lnEndX STEP nDistance
oPolygon=poform.lovpe.tovpe.olevpe.Polygon(4)
poform.lovpe.tovpe.olevpe.AddPolygonPoint(oPolygon, nHashTop + labellines.lnBeginY , tmpLabelLines.lnBeginX + nHashCounter * nDistance )
poform.lovpe.tovpe.olevpe.AddPolygonPoint(oPolygon, nHashTop + labellines.lnBeginY , tmpLabelLines.lnBeginX + nHashCounter * nDistance + nHashWidth )
poform.lovpe.tovpe.olevpe.AddPolygonPoint(oPolygon, nHashTop - nHashHeight + labellines.lnBeginY , tmpLabelLines.lnBeginX + nHashCounter * nDistance + nHashWidth + nHashWidth/2)
poform.lovpe.tovpe.olevpe.AddPolygonPoint(oPolygon, nHashTop - nHashHeight + labellines.lnBeginY , tmpLabelLines.lnBeginX + nHashCounter * nDistance + nHashWidth/2 )
nHashCounter = nHashCounter + 1
ENDFOR
poform.lovpe.tovpe.olevpe.pensize = 0
ENDIF
poform.lovpe.tovpe.olevpe.BkgColor = color_white
RETURN