Ceriwis

Ceriwis (https://forum.ceriwis.com/forum.php)
-   Programming (https://forum.ceriwis.com/forumdisplay.php?f=63)
-   -   [HELP] Kode otomatis Delphi 7 (https://forum.ceriwis.com/showthread.php?t=572638)

Guesuper 20th November 2011 12:47 AM

[HELP] Kode otomatis Delphi 7
 
Pagi sebelumnya..



buat agan2 para master programer saya minta bantuan, saya lagi ada tugas buat program di delphi 7, tentang surat jaminan kesehatan.

saya lagi bingung untuk membuat kode otomatis (jadi generate otomatis) buat primary key nanti di data base y, itu cara y gmn y?? saya udah cari sana-sini g ada bsa terus..



ini contoh yang saya buat,,

<div style="margin:20px; margin-top:5px">
Spoiler for contoh program:


<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
procedure createCode(var sKode: string);

var

i, iNoUrut : integer;

sTgl,sBlnThn,sUrut:string;

begin

sBlnThn:='';

sUrut:='';

ShortDateFormat:='mmyy';

sTgl:=DateToStr(date);

for i:=3 to 6 do

sBlnThn:=sBlnThn+sKode[i];

for i:=7 to 10 do

sUrut:=sUrut+sKode[i];

if sTgl=sBlnThn then

begin

iNoUrut:=StrToInt(sUrut)+1;

sUrut:=IntToStr(iNoUrut);

if iNoUrut


All times are GMT +7. The time now is 08:06 PM.