Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Guesuper Guesuper is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 408
Rep Power: 14
Guesuper mempunyai hidup yang Normal
Default [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,,


Spoiler for contoh program:




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

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 05:30 AM.


no new posts