Membuat Program Menu 2
set talk off
set stat off
set score off
set color to 'n/n/n'
clear
cr1=""
cr2=""
cr3=chr(16)
cr4=chr(17)
m11=cr3+" Tambah "+cr4
m12=cr3+" hapus "+cr4
m13=cr3+" edit "+cr4
m14=cr3+" laporan "+cr4
m15=cr3+" selesai "+cr4
v1=">>"
v2="<<"
v3=""
kl=20
br=10
store 0 to B
pj=len(m11)
jrk=2
jmlmenu=5
@ br-jrk,kl-jrk-1 to br+jmlmenu +1, kl+pj+jrk+3 color'r+/n' double
@ br-jrk,kl+jrk say "menu" color 'gr+/r'
@ br,kl+jrk say m11 color 'n/w'
@ br+1,kl+jrk say m12 color 'w/n'
@ br+2,kl+jrk say m13 color 'w/n'
@ br+3,kl+jrk say m14 color 'w/n'
@ br+4,kl+jrk say m15 color 'w/n'
do while .t.
a=inkey()
do case
case a=0
loop
case a=27
exit
case a=24
b=b+1
if b>jmlmenu
b=1
endif
case a=5
b=b-1
if b=0
b=jmlmenu
endif
endcase
do case
case b=1
&& tambah data
@ br,kl+jrk say m11 color 'n/w'
@ br+1,kl+jrk say m12 color'w/n'
@ br+2,kl+jrk say m13 color'w/n'
@ br+3,kl+jrk say m14 color'w/n'
@ br+4,kl+jrk say m15 color'w/n'
if a=13
do t30.prg &&database1
endif
case b=2
&& hapus data
@ br+1,kl+jrk say m12 color'n/w'
@ br,kl+jrk say m11 color'w/n'
@ br+2,kl+jrk say m13 color'w/n'
@ br+3,kl+jrk say m14 color'w/n'
@ br+4,kl+jrk say m15 color'w/n'
if a=13
do h30.prg &&database2
endif
case b=3
@ br+2,kl+jrk say m13 color'n/w'
@ br,kl+jrk say m11 color'w/n'
@ br+1,kl+jrk say m12 color'w/n'
@ br+3,kl+jrk say m14 color'w/n'
@ br+4,kl+jrk say m15 color'w/n'
if a=13
do e30.prg &&database3
endif
case b=4
@ br+3,kl+jrk say m14 color'n/w'
@ br,kl+jrk say m11 color'w/n'
@ br+1,kl+jrk say m12 color'w/n'
@ br+2,kl+jrk say m13 color'w/n'
@ br+4,kl+jrk say m15 color'w/n'
if a=13
do L30.prg &&database4
endif
case b=5
@ br+4,kl+jrk say m15 color'n/w'
@ br,kl+jrk say m11 color'w/n'
@ br+1,kl+jrk say m12 color'w/n'
@ br+2,kl+jrk say m13 color'w/n'
@ br+3,kl+jrk say m14 color'w/n'
if a=13
exit
endif
endcase
set color to 'w/n'
enddo
set color to 'w/n/b+/'
Semoga bermanfaat :D
0 komentar:
Posting Komentar