Arsip: Looping lagi...
more 12 years ago
idhiel
Mohon petunjuk para master2...
langsung aja pada masalahx
aq ingin saat record2 di dbf2 di pindahkan ke dbf 3,
jika ada record di field noref(dbf3) = record di field wbno(dbf2) maka dbf3 dalam posisi Edit & jika sebaliknya Append
masalahx codex membuat aplikasi jadi Hank...
kodex seperti ini
procedure TForm9.bii;
var jumlah : integer;
begin
jumlah := 0;
dm.Dbf2.Close ;
dm.Dbf2.TableName := sedit1.Text ;
dm.Dbf2.FilePath := sedit2.Text ;
dm.Dbf2.FilePathFull := sedit2.Text ;
dm.Dbf2.Active := true;
dm.Dbf3.Active := true;
while NOT dm.Dbf2.Eof do
begin
if dm.Dbf3.Locate('noref',dm.Dbf2['Wbno'],[]) then <<=== Saya kira masalahx ada disini
begin
dm.Dbf3.Edit ;
dm.Dbf3['cycle'] := dm.Dbf2['cycle'];
dm.Dbf3['nama'] := dm.Dbf2['nama'];
dm.Dbf3['addrs'] := dm.Dbf2['addr'];
dm.Dbf3['kodepos'] := dm.Dbf2['kodepos'];
dm.Dbf3['upload'] := dm.Dbf2['Pudt'];
dm.Dbf3['bank'] := sedit3.Text ;
dm.Dbf3.Post ;
end
else
begin
dm.Dbf3.Open ;
dm.Dbf3.Append ;
dm.Dbf3['noref'] := dm.Dbf2['Wbno'];
dm.Dbf3['cycle'] := dm.Dbf2['cycle'];
dm.Dbf3['nama'] := dm.Dbf2['nama'];
dm.Dbf3['addrs'] := dm.Dbf2['addr'];
dm.Dbf3['kodepos'] := dm.Dbf2['kodepos'];
dm.Dbf3['upload'] := dm.Dbf2['Pudt'];
dm.Dbf3['bank'] := sedit3.Text ;
dm.Dbf3.Post ;
jumlah := jumlah + 1;
dm.Dbf2.Next;
end;
slabelfx2.Caption := inttostr(jumlah);
dm.Dbf3.Refresh ;
end;
end;
mohon pencerahannx master...
more 12 years ago
halimanh
ada infinite loop tuh di dalam while loopnya.
if ... then
begin
...
...nggak ada dm.Dbf2.Next; nya
end
else
begin
...
end;
@idhiel: Mohon petunjuk para master2... langsung aja pada masalahx aq ingin saat record2 di dbf2 di pindahkan ke dbf 3, jika ada record di field noref(dbf3) = record di field wbno(dbf2) maka dbf3 dalam posisi Edit & jika sebaliknya Append masalahx codex membuat aplikasi jadi Hank... kodex seperti inimohon pencerahannx master...procedure TForm9.bii; var jumlah : integer; begin jumlah := 0; dm.Dbf2.Close ; dm.Dbf2.TableName := sedit1.Text ; dm.Dbf2.FilePath := sedit2.Text ; dm.Dbf2.FilePathFull := sedit2.Text ; dm.Dbf2.Active := true; dm.Dbf3.Active := true; while NOT dm.Dbf2.Eof do begin if dm.Dbf3.Locate('noref',dm.Dbf2['Wbno'],[]) then <<=== Saya kira masalahx ada disini begin dm.Dbf3.Edit ; dm.Dbf3['cycle'] := dm.Dbf2['cycle']; dm.Dbf3['nama'] := dm.Dbf2['nama']; dm.Dbf3['addrs'] := dm.Dbf2['addr']; dm.Dbf3['kodepos'] := dm.Dbf2['kodepos']; dm.Dbf3['upload'] := dm.Dbf2['Pudt']; dm.Dbf3['bank'] := sedit3.Text ; dm.Dbf3.Post ; end else begin dm.Dbf3.Open ; dm.Dbf3.Append ; dm.Dbf3['noref'] := dm.Dbf2['Wbno']; dm.Dbf3['cycle'] := dm.Dbf2['cycle']; dm.Dbf3['nama'] := dm.Dbf2['nama']; dm.Dbf3['addrs'] := dm.Dbf2['addr']; dm.Dbf3['kodepos'] := dm.Dbf2['kodepos']; dm.Dbf3['upload'] := dm.Dbf2['Pudt']; dm.Dbf3['bank'] := sedit3.Text ; dm.Dbf3.Post ; jumlah := jumlah + 1; dm.Dbf2.Next; end; slabelfx2.Caption := inttostr(jumlah); dm.Dbf3.Refresh ; end; end;
more 12 years ago
idhiel
aq dah tambahkan yg agan maksud,
but kok jadi sangat lambat ya,,,
walaupun dalam field noref dbf3 kagak ada yg sama dengan field Wbno dbf2..
kayaknya code ini kagak berfungsi
if dm.Dbf3.Locate('noref',dm.Dbf2['Wbno'],[]) then
kalau codex hanya seperti ini,maka proses jadi cepat
while NOT dm.Dbf2.Eof do
begin
dm.Dbf3.Open ;
dm.Dbf3.Append ;
dm.Dbf3['noref'] := dm.Dbf2['Wbno'];
dm.Dbf3['cycle'] := dm.Dbf2['cycle'];
dm.Dbf3['nama'] := dm.Dbf2['nama'];
dm.Dbf3['addrs'] := dm.Dbf2['addr'];
dm.Dbf3['kodepos'] := dm.Dbf2['kodepos'];
dm.Dbf3['upload'] := dm.Dbf2['Pudt'];
dm.Dbf3['bank'] := sedit3.Text ;
dm.Dbf3.Post ;
jumlah := jumlah + 1;
dm.Dbf2.Next;
end;
slabelfx2.Caption := inttostr(jumlah);
dm.Dbf3.Refresh ;
end;
more 12 years ago
idhiel
aq dah tambahkan yg agan maksud,
but kok jadi sangat lambat ya,,,
walaupun dalam field noref dbf3 kagak ada yg sama dengan field Wbno dbf2..
kayaknya code ini kagak berfungsi
if dm.Dbf3.Locate('noref',dm.Dbf2['Wbno'],[]) then
kalau codex hanya seperti ini,maka proses jadi cepat
while NOT dm.Dbf2.Eof do
begin
dm.Dbf3.Open ;
dm.Dbf3.Append ;
dm.Dbf3['noref'] := dm.Dbf2['Wbno'];
dm.Dbf3['cycle'] := dm.Dbf2['cycle'];
dm.Dbf3['nama'] := dm.Dbf2['nama'];
dm.Dbf3['addrs'] := dm.Dbf2['addr'];
dm.Dbf3['kodepos'] := dm.Dbf2['kodepos'];
dm.Dbf3['upload'] := dm.Dbf2['Pudt'];
dm.Dbf3['bank'] := sedit3.Text ;
dm.Dbf3.Post ;
jumlah := jumlah + 1;
dm.Dbf2.Next;
end;
slabelfx2.Caption := inttostr(jumlah);
dm.Dbf3.Refresh ;
end;
more 12 years ago
halimanh
locate memang pelan. tabelnya di index nggak?
@idhiel: aq dah tambahkan yg agan maksud, but kok jadi sangat lambat ya,,, walaupun dalam field noref dbf3 kagak ada yg sama dengan field Wbno dbf2.. kayaknya code ini kagak berfungsikalau codex hanya seperti ini,maka proses jadi cepatif dm.Dbf3.Locate('noref',dm.Dbf2['Wbno'],[]) then
while NOT dm.Dbf2.Eof do begin dm.Dbf3.Open ; dm.Dbf3.Append ; dm.Dbf3['noref'] := dm.Dbf2['Wbno']; dm.Dbf3['cycle'] := dm.Dbf2['cycle']; dm.Dbf3['nama'] := dm.Dbf2['nama']; dm.Dbf3['addrs'] := dm.Dbf2['addr']; dm.Dbf3['kodepos'] := dm.Dbf2['kodepos']; dm.Dbf3['upload'] := dm.Dbf2['Pudt']; dm.Dbf3['bank'] := sedit3.Text ; dm.Dbf3.Post ; jumlah := jumlah + 1; dm.Dbf2.Next; end; slabelfx2.Caption := inttostr(jumlah); dm.Dbf3.Refresh ; end;
more ...
- Pages:
- 1
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 4 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- finger print with delphi
by ntedscyber in Tip n Trik Pemrograman more 14 years ago - koneksi SQl lambat banget ( pake ADO )
by listia in Hal umum tentang Pascal Indonesia more 16 years ago - gmana supaya panel selalu tampil di tengah aplikasi
by fongers in Tip n Trik Pemrograman more 15 years ago - Menambahkan Text Dalam Foto
by supermuam in Multimedia & Graphic Enhancement more 13 years ago - gabungin 2 komponen
by esafm in Tip n Trik Pemrograman more 16 years ago - koneksi delphi di win 7 ke mysql di ubuntu
by rianhidayat in MySQL more 12 years ago - Width Cell StringGrids
by unank in Hal umum tentang Pascal Indonesia more 17 years ago - rave report
by marvel in Enginering more 19 years ago - Aneh
by don2103 in MsSQL more 14 years ago - Tnya soal xml untuk sound recognition!
by thokvest in Multimedia & Graphic Enhancement more 16 years ago