var vRSID as Int var vRecs as Int var vNextCheck as String var n as Int
Subroutine PRINTCHECKS()
var i as Int var vFont as String = "Courier New" var vSize as Int = 16
For i = 1 to vRecs Step 3
XResultSetCurrentPosition(vRSID, i)
NewPage(850, 1100)
If i <= vRecs { PrintString(@Decimals(@XResultSetValue(vRSID, "Check#"), 0), 725, 50, 0, "B" + vFont, vSize, 0) PrintString(@AsFormattedByLE(Today, 0,@XResultSetValue(vRSID, "CheckDate")), 630, 85, 0, vFont, vSize, 0) PrintString("$ " + @Decimals(@XResultSetValue(vRSID, "Amount"), 2), 700, 125, 0, vFont, vSize, 0) PrintString(@XResultSetValue(vRSID, "Order Of"), 125, 140, 0, vFont, vSize, 0) PrintString(@XResultSetValue(vRSID, "F0007"), 40, 175, 0, vFont, vSize, 0) PrintString(@XResultSetValue(vRSID, "Memo"), 80, 260, 0, vFont, vSize - 3, 0) PrintString(@XResultSetValue(vRSID, "Blank"), 80, 280, 0, vFont, vSize - 3, 0) }
If i + 1 <= vRecs { XResultSetCurrentPosition(vRSID, i + 1)
PrintString(@Decimals(@XResultSetValue(vRSID, "Check#"), 0), 725, 380, 0, "B" + vFont, vSize, 0) PrintString(@AsFormattedByLE(Today, 0,@XResultSetValue(vRSID, "CheckDate")), 630, 425, 0, vFont, vSize, 0) PrintString("$ " + @Decimals(@XResultSetValue(vRSID, "Amount"), 2), 700, 475, 0, vFont, vSize, 0) PrintString(@XResultSetValue(vRSID, "Order Of"), 125, 490, 0, vFont, vSize, 0) PrintString(@XResultSetValue(vRSID, "F0007"), 40, 525, 0, vFont, vSize, 0) PrintString(@XResultSetValue(vRSID, "Memo"), 80, 610, 0, vFont, vSize - 3, 0) PrintString(@XResultSetValue(vRSID, "Blank"), 80, 630, 0, vFont, vSize - 3, 0) }
If i + 2 <= vRecs { XResultSetCurrentPosition(vRSID, i + 2)
PrintString(@Decimals(@XResultSetValue(vRSID, "Check#"), 0), 725, 735, 0, "B" + vFont, vSize, 0) PrintString(@AsFormattedByLE(Today, 0,@XResultSetValue(vRSID, "CheckDate")), 630, 780, 0, vFont, vSize, 0) PrintString("$ " + @Decimals(@XResultSetValue(vRSID, "Amount"), 2), 700, 825, 0, vFont, vSize, 0) PrintString(@XResultSetValue(vRSID, "Order Of"), 125, 840, 0, vFont, vSize, 0) PrintString(@XResultSetValue(vRSID, "F0007"), 40, 875, 0, vFont, vSize, 0) PrintString(@XResultSetValue(vRSID, "Memo"), 80, 955, 0, vFont, vSize - 3, 0) PrintString(@XResultSetValue(vRSID, "Blank"), 80, 975, 0, vFont, vSize - 3, 0) }
FinishPage()
Next
End Subroutine
// Begin main program
vRSID = @XResultSetSearch(@FN, "CK-DEAL", 0, 2, "!Print Check=Y", "!Amount=/=")
XResultSetSort(vRSID, "Check#:-1")
vRecs = @XResultSetTotal(vRSID)
If vRecs > 0 { WriteLn("The following " + vRecs + " checks are marked 'Y' for printing:") WriteLn("------------------------------------------------------") WriteLn("")
For n = 1 to vRecs
XResultSetCurrentPosition(vRSID, n)
vNextCheck = "Check#: " + @Decimals(@XResultSetValue(vRSID, "Check#"), 0) + @NL() + "Date: " + @AsFormattedByLE(Today, 0,@XResultSetValue(vRSID, "CheckDate")) + @NL() + "Amount: " + "$ " + @Decimals(@XResultSetValue(vRSID, "Amount"), 2) + @NL() + "Payee: " + @XResultSetValue(vRSID, "Order Of") + @NL() + "Memo: " + @XResultSetValue(vRSID, "Memo") + @NL() + "Memo2: " + @XResultSetValue(vRSID, "Blank") + @NL()
WriteLn(vNextCheck) Next
If @Askuser(vRecs + " check(s) to print...","","Do you want to continue?") { PRINTCHECKS()
If @Askuser("Did all the checks print OK?","","(Answer 'YES' to mark them as printed)") { For n = 1 to vRecs XResultSetCurrentPosition(vRSID, n) XResultSetValue(vRSID, "Print Check", "N") Next
@Msgbox("The " + vRecs + " checks have been marked as printed.","","")
} Else { @Msgbox("Edit the pertinent check records as necessary,","then return here and reprint those still marked with a 'Y'","") }
} } Else { @Msgbox("No checks marked 'Y' for printing found.","","") }
XResultSetClose(vRSID)
|