belajar code foxpro programing


contoh program foxpro
set talk off
set color to w/n

clear
@0,0,24,79 box" "
@4,15 clear to 21,64
@4,15 to 21,64 color w+/n
@7,15 to 7,64 color w+/n
@19,15 to 19,64 color w+/n
@7,15 say"Ã" color w+/n
@7,64 say"´" color w+/n
@19,15 say"Ã" color w+/n
@19,64 say"´" color w+/n

x1="PT. FENDER COORPORATION"
X2="JL. Raya Mojokerto - Surabaya No. 1-5"
@5, (wcols()-len (x1))/2 say x1 color rg+/n
@6, (wcols()-len (x2))/2 say x2 color w+/n

x3="M E N U  U T A M A"
@8, (wcols()-len (x3))/2 say x3 color bg+/n
@8,16 to 8,63fill color bg+/r
@10,18 to 16,61 fill color w+/w
@11,19 say"1. Penjualan Oleh Sales" color w+/n
@12,19 say"2. Laporan Stock Barang" color W+/w
@13,19 say"3. Keluar Dari Program" color w+/w

x4="NIKMATI KEUNGGULAN KAMI"
@5, (wcols()-len (x4))/2 say x4 color rg+/n
@18,21 SAY"Masukan Nomor Menu Pilihan Anda : " get pilih defa 0 pict "9";
        valid pilih>=1 and pilih<3 error "Kode Hanya 1 Sampai 3";
        color bg+/n,w+/bg
read
do case
    case pilih=1
    do Penjualan
    case pilih=2
   
    case pilih=3
   
endcase

Procedure Penjualan
clear

@0,0,24,79 box"ÎÎÎÎÎÎÎÎÎ"
@4,15 clear to 22,64
@4,15 to 22,64 color w+/n
@7,15 to 7,64 color w+/n
@20,15 to 20,64 color w+/n
@7,15 say"Ã" color w+/n
@7,64 say"´" color w+/n
@20,15 say"Ã" color w+/n
@20,64 say"´" color w+/n

x1="PT. FENDER COORPORATION"
X2="JL. Raya Mojokerto - Surabaya No. 1-5"
@5, (wcols()-len (x1))/2 say x1 color rg+/n
@6, (wcols()-len (x2))/2 say x2 color w+/n

x3="PENJUALAN OLEH SALES"
@8, (wcols()-len (x3))/2 say x3 color bg+/n
@8,16 to 8,63fill color bg+/r

x4="NIKMATI KEUNGGULAN KAMI"
@5, (wcols()-len (x4))/2 say x4 color rg+/n
@10,19 say"No. Induk  : " get no defa space(4)
@11,19 say"Nama Sales : " get nama defa space(20)
@14,19 to 14,60
@17,19 to 17,60
@13,40 to 17,40
@14,40 say"Å"
@17,40 say"Á"
@13,19 say"Barang      Jumlah" color rg+/n
@13,43 say"Barang      Jumlah" color rg+/n
@15,19 say"Bass Fender   " get bass defa 0 pict"99"
    read
@15,42 say"Gitar Fender  " get gitar defa 0 pict"99"
    read
@16,19 say"Cymbal Tama   " get tama defa 0 pict"99"
    read
@16,42 say"Tamborine     " get tamborine  defa 0 pict"99"
    read
   
total=bass+gitar+tama+tamborine
@18,19 say"Total Jumlah : "+alltr(str(total))
if total<=20
    ket="Biasa"
    else
     if total<=40
           ket="Bagus"
           else
            ket="Memuaskan"
      endif
    endif
@19,19 say"Keterangan   : "+ket

@21,19 SAY"Masukan Nomor: " get pilih defa 0 pict "9";
        mess" pilihan 1 ke menu dan 2 mengisi kembali";
        valid pilih>=1 and pilih<=2 error "Kode Hanya 1 dan 2";
        color bg+/n,w+/bg
read
do case
    case pilih=1
    do menu
    case pilih=2
    do Penjualan
endcase

procedure menu
@0,0,24,79 box" "
@4,15 clear to 21,64
@4,15 to 21,64 color w+/n
@7,15 to 7,64 color w+/n
@19,15 to 19,64 color w+/n
@7,15 say"Ã" color w+/n
@7,64 say"´" color w+/n
@19,15 say"Ã" color w+/n
@19,64 say"´" color w+/n

x1="PT. FENDER COORPORATION"
X2="JL. Raya Mojokerto - Surabaya No. 1-5"
@5, (wcols()-len (x1))/2 say x1 color rg+/n
@6, (wcols()-len (x2))/2 say x2 color w+/n

x3="M E N U  U T A M A"
@8, (wcols()-len (x3))/2 say x3 color bg+/n
@8,16 to 8,63fill color bg+/r
@10,18 to 16,61 fill color w+/w
@11,19 say"1. Penjualan Oleh Sales" color w+/n
@12,19 say"2. Laporan Stock Barang" color W+/w
@13,19 say"3. Keluar Dari Program" color w+/w

x4="NIKMATI KEUNGGULAN KAMI"
@5, (wcols()-len (x4))/2 say x4 color rg+/n
@18,21 SAY"Masukan Nomor Menu Pilihan Anda : " get pilih defa 0 pict "9";
        valid pilih>=1 and pilih<=3 error "Kode Hanya 1 Sampai 3";
        color bg+/n,w+/bg
read
do case
    case pilih=1
    do Penjualan
    case pilih=2
   
    case pilih=3
   
endcase

Iklan

loading...