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 4 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
- ada yang pernah pake ISO buat transaksi ATM
by alvonz in Enginering more 16 years ago - help..
by o-dad in Hal umum tentang Pascal Indonesia more 15 years ago - Sinkronisasi 2 client
by madi in Paradox more 17 years ago - List Index out of bounds
by vandy in Enginering more 16 years ago - EAccessViolation, tolooong...
by doniking in Hal umum tentang Pascal Indonesia more 17 years ago - Membaca tombol CapsLock, NumLock, ScrollLock
by doditali in Tip n Trik Pemrograman more 19 years ago - Tampilan DBGRID
by xproof in Tip n Trik Pemrograman more 16 years ago - Text to DbGrid
by e_soep in Tip n Trik Pemrograman more 17 years ago - Running and Update same database
by RoenZ in Lain-lain more 15 years ago - quick report with zquery
by sulth4n in Tip n Trik Pemrograman more 18 years ago