Posted by : San Rabu, 16 Januari 2013

Logika nya menyusul ya... adminnya masih pegel... :D



1 CLS
PRINT "+----------------------------+"
PRINT "+ DATA BASE GUNADARMA DISTRO +"
PRINT "+----------------------------+"
PRINT "1. MASUKAN PRODUK"
PRINT "2. TAMPILKAN PRODUK"
PRINT "3. UPDATE PRODUK"
PRINT "4. HAPUS PRODUK"
PRINT "5. EXIT"
INPUT "PILIH :"; X
SELECT CASE X

CASE 1
GOTO 10

CASE 2
GOTO 20

CASE 3
GOTO 30

CASE 4
GOSUB HAPUS:

CASE 5
GOTO 100

CASE ELSE
PRINT "Tidak ada Pilihan"

END SELECT

10 CLS
PRINT SPC(10); " Gunadarma Distro "
PRINT STRING$(44, "-")
OPEN "a.dat" FOR OUTPUT AS #1
INPUT "Banyak Data :"; BD
FOR i = 1 TO BD
INPUT "Kode ="; Kd$
INPUT "Kategori  ="; Jns$
INPUT "Merek  ="; Mrk$
INPUT "Ukuran ="; Ukr$
INPUT "Harga  ="; Hrg
PRINT STRING$(44, "-")
WRITE #1, Kd$, Jns$, Mrk$, Ukr$, Hrg
NEXT i
CLOSE
PRINT "BUTUH APA LAGI?"
PRINT "1.TAMPILKAN DATA"
PRINT "2.UPDATE DATA"
PRINT "3.HAPUS DATA"
PRINT "4.EXIT"
INPUT "PILIH :", X
SELECT CASE X

CASE 1
GOTO 20

CASE 2
GOTO 30

CASE 3
GOSUB HAPUS:

CASE 4
GOTO 100

CASE ELSE
PRINT "Tidak ada Pilihan"

END SELECT

20 CLS
PRINT SPC(33); "Gunadarma Distro"
PRINT STRING$(80, "-")
PRINT SPC(9); "Kode"; SPC(9); "Kategori"; SPC(9); "Merek"; SPC(9); "Ukuran"; SPC(9); "Harga"
PRINT STRING$(80, "-")
items$ = "         \    \       \      \         \            \  \  \       ########"
OPEN "a.dat" FOR INPUT AS #1
DO UNTIL EOF(1)
INPUT #1, Kd$, Jns$, Mrk$, Ukr$, Hrg
PRINT USING items$; Kd$; Jns$; Mrk$; Ukr$; Hrg
LOOP
PRINT STRING$(80, "-")
CLOSE
PRINT "BUTUH APA LAGI?"
PRINT "1.MASUKAN PRODUK"
PRINT "2.UPDATE PRODUK"
PRINT "3.HAPUS DATA"
PRINT "4.EXIT"
INPUT "PILIH :", X
SELECT CASE X

CASE 1
GOTO 10

CASE 2
GOTO 30

CASE 3
GOSUB HAPUS:

CASE 4
GOTO 100

CASE ELSE
PRINT "Tidak ada Pilihan"

END SELECT



30 CLS
OPEN "a.dat" FOR APPEND AS #1
Jns$ = "xxx"
DO UNTIL Kd$ = ""
PRINT "Enter for End"
INPUT "Kode = "; Kd$
IF Kd$ = "" THEN EXIT DO
INPUT "Kategori ="; Jns$
INPUT "Merek ="; Mrk$
INPUT "Ukuran ="; Ukr$
INPUT "Harga ="; Hrg
PRINT STRING$(44, "-")
WRITE #1, Kd$, Jns$, Mrk$, Ukr$, Hrg
LOOP
CLOSE
PRINT "BUTUH APA LAGI?"
PRINT "1.MASUKAN PRODUK"
PRINT "2.TAMPILKAN PRODUK"
PRINT "3.HAPUS DATA"
PRINT "4.EXIT"
INPUT "PILIH :", X
SELECT CASE X

CASE 1
GOTO 10

CASE 2
GOTO 20

CASE 3
GOSUB HAPUS:

CASE 4
GOTO 100

CASE ELSE
PRINT "Tidak ada Pilihan"

END SELECT

HAPUS:
CLS
OPEN "a.dat" FOR INPUT AS #1
OPEN "c.dat" FOR OUTPUT AS #2
DO UNTIL EOF(1)
INPUT #1, Kd$, Jns$, Mrk$, Ukr$, Hrg
WRITE #2, Kd$, Jns$, Mrk$, Ukr$, Hrg
LOOP
CLOSE 2
CLOSE 1

112 CLS
PRINT SPC(33); "Gunadarma Distro"
PRINT STRING$(80, "-")
PRINT SPC(9); "Kode"; SPC(9); "Kategori"; SPC(9); "Merek"; SPC(9); "Ukuran"; SPC(9); "Harga"
PRINT STRING$(80, "-")
items$ = "         \    \       \      \         \            \  \  \       ########"
OPEN "a.dat" FOR INPUT AS #1
DO UNTIL EOF(1)
INPUT #1, Kd$, Jns$, Mrk$, Ukr$, Hrg
PRINT USING items$; Kd$; Jns$; Mrk$; Ukr$; Hrg
LOOP
PRINT STRING$(80, "-")
CLOSE

PRINT " Baris berapa yg akan di hapus [0 utk abaikan]";
INPUT ""; brs
IF brs = 0 THEN GOTO 100
IF brs > 0 THEN
GOTO 111
ELSE
GOTO HAPUS
END IF
GOTO 1

111 CLOSE 1
BARIS = 0
OPEN "c.dat" FOR INPUT AS #1
OPEN "a.dat" FOR OUTPUT AS #2
DO UNTIL EOF(1)
INPUT #1, Kd$, Jns$, Mrk$, Ukr$, Hrg
BARIS = BARIS + 1
IF BARIS <> brs THEN
WRITE #2, Kd$, Jns$, Mrk$, Ukr$, Hrg
END IF
LOOP
CLOSE 2
CLOSE 1
KILL "c.dat"
GOTO HAPUS:

100 END

{ 1 komentar... read them below or add one }

Popular Post

Blogger templates

Blog Archive

ReeCoder. Diberdayakan oleh Blogger.

Followers

Gunadarma Headline News

Me on Google+

- Copyright © Ree San -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -