
I save the totals of the bets in an array

when I go to print I have to break down each total and I have to have the corresponding columns and rows
through a function that I also use in the program I proceed with the decomposition and save positions on array

however I realized that in print I have everything in reverse and therefore the second column of the array is actually the row in the print
so i thought about converting the print command
Code: Select all | Expand
for nI := 1 to len( aImports )
nColonna := aImports[ nI ][2]
nRiga := aImports[ nI ][1]
instead of
Code: Select all | Expand
for nI := 1 to len( aImports )
nColonna := aImports[ nI ][1]
nRiga := aImports[ nI ][2]
But work bad because it print this

How I can resolve it ?
this is the function to print that area
Code: Select all | Expand
// Imports
#define _MARGIN_TOP_IMPORTS 10.83
#define _MARGIN_LEFT_IMPORTS 2.25
#define _SQUARE_RAD_IMPORTS 0.9
#define _SQUARE_LEFT_IMPORTS 10.2
#define _SQUARE_SIZE_IMPORTS 0.44
#define _SQUARE_DIST_IMPORTS 0.13
#define _XSPACE_IMPORTS 0.57
#define _YSPACE_IMPORTS 0.7
Function Print_Imports( oPrn, oPen, aImports, oBrush )
LOCAL n, o
LOCAL nI
LOCAL nTop, nLeft, nBottom, nRight, aRect
LOCAL nVar := 1
LOCAL nRow, nCol
LOCAL nRadH := _SQUARE_RAD_IMPORTS * ( 10 * oPrn:nHorzRes() / oPRn:nHorzSize() ) / 10 // radius for round boxes in printer resolution horizontal
LOCAL nRadV := _SQUARE_RAD_IMPORTS * ( 10 * oPrn:nVertRes() / oPrn:nVertSize() ) / 10 // radius for round boxes in printer resolution vertical
local ncolonna, nRiga
//print Imports Errors
for nI := 1 to len( aImports )
nColonna := aImports[ nI ][2]
nRiga := aImports[ nI ][1]
nRow := int( nRiga / 8 )
nCol := ( nColonna % 13 )
if nCol == 0
nCol := 13
else
++nRow
endif
nTop := _MARGIN_TOP_IMPORTS + .1 + ( --nRow * _YSPACE ) // + .1 to make square smaller than circle
nLeft := _MARGIN_LEFT_IMPORTS + .1 + ( --nCol * _XSPACE ) // + .1 to make square smaller than circle
nBottom := nTop - .2 + _SQUARE_SIZE_IMPORTS // - .2 to make square smaller than circle
nRight := nLeft - .2 + _SQUARE_SIZE_IMPORTS // - .2 to make square smaller than circle
oPrn:Cmtr2Pix( @nTop, @nLeft )
oPrn:Cmtr2Pix( @nBottom, @nRight )
aRect := { nTop, nLeft , nBottom , nRight }
oPrn:FillRect( aRect, oBrush )
next
return nil
in the demo calibration of the receipt the correct printing coordinates as you can see in this example
