Ik weet niet of dat duidelijker is - Ik dacht het zo eenvoudig mogelijk te houden.
Alles heb ik zo'n beetje aan en uitgeschakeld en toen bleef alleen die boosdoener
over op regel 21. >> Inc(MC,strtoint(hokje[y].Text));
Code:
Procedure Kaarttel;
var k, y ,z: integer;
blVlag: bool;
begin
kaartcode:='';
k:=0; MC:=0; z:=0;
// WAARDE OPTELLINGEN:
K1:=0;K2:=0;K3:=0;K4:=0;K5:=0;K6:=0;K7:=0;K8:=0;K9:=0;K10:=0;K11:=0;K12:=0;
AA:=0;BB:=0;CC:=0;DD:=0;EE:=0;FF:=0;GG:=0;HH:=0;II:=0;JJ:=0;KK:=0;LL:=0;
blVlag:=false;
for y := 0 to High(hokje) do // is van hokje 1 t/m 144
begin
inc(k,1); // Rijtjes van 12 maken
//-----
if hokje[y].Text <> '' then // Edithokje is standaard tekst
begin
blVlag:=true;
if StrToInt(hokje[y].text) > 0 then
begin
Inc(MC,strtoint(hokje[y].Text)); // << HIER GAAT HET FOUT
if MaxW < 36 then
kaartcode:=kaartcode+' - '+kaartxt[strtoint(hokje[y].Text)]
else
kaartcode:=kaartcode+' - '+(hokje[y].Text);
end;
end;
//-----
if k=12 then
begin
if blVlag=true then // Knip de verschillende Tekststrings in stukjes van 12
begin
kaartcode:=kaartcode+Chr(10);
kaartcode:=stringreplace(kaartcode,chr(10)+' -',chr(10),[]);
end;
k:=0;
blVlag:=false;
end;
//-----
end;
Delete(kaartcode,1,2); // De 1e 2 karakters uit de Tekststring strippen.
//--------------------
if MC>MaxW then MC:=MC mod MaxW;
if (MC>0) and (MC<MaxW) then MC:=MC; // Indien RESTWaarde is 0!
if (MaxW=36)and (MC>0) and (MC<37) then MyForm.MagCard.Caption:=kaartxt[MC]
else MyForm.MagCard.Caption:='Nr. '+inttostr(MC);
end;
Bookmarks