Otomatik barkod oluşturma yapıyorum
barkodun kontrol numarasını hesaplamak için mid fonk. kullanmaya çalıştım ama hata veriyor
" "is not a valid floating point value "
kod:
Kod: Tümünü seç
procedure Tstok_kayit_form.SpeedButton11Click(Sender: TObject);
var
top1,top2,top3,top4,top5,top6,top7,top8,top9,top10,top11,top12:real;
barkod,barkod_no:string;
toplam,kalan,kalan1:integer;
begin
if data.ayarlarBARKOD_KUL_DURUMU.AsString='EVET' then begin
data.ayarlar.Edit;
data.ayarlarURUN_KODU.AsInteger:=data.ayarlarURUN_KODU.AsInteger+1;
barkod_no:=inttostr(data.ayarlarULKE_KODU.Asinteger)+inttostr(data.ayarlarFIRMA_KODU.Asinteger)+inttostr(data.ayarlarURUN_KODU.Asinteger);
data.ayarlarBARKOD_NO.AsFloat:=strtofloat(barkod_no);
top1:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),1,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),1,1)));
top2:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),2,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),2,1)));
top3:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),3,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),3,1)));
top4:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),4,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),4,1)));
top5:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),5,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),5,1)));
top6:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),6,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),6,1)));
top7:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),7,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),7,1)));
top8:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),8,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),8,1)));
top9:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),9,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),9,1)));
top10:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),10,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),10,1)));
top11:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),11,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),11,1)));
top12:=strtofloat((midstr(floattostr(data.ayarlarBARKOD_NO.Asfloat),12,1)))*strtofloat((midstr(floattostr(data.ayarlarAGIRLIK_KODU.Asfloat),12,1)));
toplam:=strtoint(floattostr(top1+top2+top3+top4+top5+top6+top7+top8+top9+top10+top11+top12));
kalan1:=data.ayarlarMODUL_KODU.asinteger;
kalan:=(toplam mod kalan1);
data.ayarlarKONTROL_NO.AsInteger:=data.ayarlarMODUL_KODU.asinteger-kalan;
data.ayarlar.Post;
//------------------------------
data.stok_kayit.Edit;
barkod:=FLOATTOSTR(data.ayarlarBARKOD_NO.asfloat)+INTTOSTR(data.ayarlarKONTROL_NO.AsInteger);
data.stok_kayitBARKOD.Asfloat:=strtofloat(barkod);
data.stok_kayit.Post;
//-------------------------------
end;
end;