Forum: Object-Pascal / Delphi-Language
by jfheins,
28. Mär 2009
Du brichst zu früh ab:if (PageIndex * CONTACTS_PER_PAGE + j) = FContactList.Count - 1 then break;
So isses richtig:if (PageIndex * CONTACTS_PER_PAGE + j) = FContactList.Count then break;
*g*
@jänicke: Das passt schon. (5 - 1) div 3 = 4 div 3 = 1
also for i := 0 to 1 do
macht Seite 0 und Seite 1 = 2 Seiten ;)
Forum: Object-Pascal / Delphi-Language
by jfheins,
28. Mär 2009
Okay, sorry - hatte noch ein paar Fehlerchen drin :stupid:
Hier der (getestete) C# Quellcode:
for (int i = 0; i < (ContactCount + SetsPerPage - 1) / SetsPerPage; i++)
{
for (int j = 0; j < SetsPerPage; j++)
{
if ((i * SetsPerPage + j) == ContactCount) break;
listBox1.Items.Add(string.Format("Index: {0}...
Forum: Object-Pascal / Delphi-Language
by jfheins,
28. Mär 2009
Dafür wird der Funktion PrintAllContact jetzt die Position angegebenen an der der Datensatz gedruckt werden soll ;)
PrintAllContact(j, Printer.Canvas, FContactList.Items);
Forum: Object-Pascal / Delphi-Language
by jfheins,
28. Mär 2009
Getippt:const SetsPerPage = 2;
for i := 0 to (FContactList.Count - 1) div SetsPerPage do
begin
PrintAllContactsHeader(Printer.Canvas);
PrintAllContactsFooter(Printer.Canvas, Printer.PageNumber);
for j := 0 to SetsPerPage - 1 do
begin
if (i * SetsPerPage + j) = FContactList.Count then break;