PENGGUNAAN IF BERTINGKAT PADA FOXPRO
Pada text2 ketikan kode SBB
with thisform
if .text1.value="VIP"
 .text3.value=val(.text2.Value)*500000
 Else
if .text1.value="Kelas 1" 
 .text3.value=val(.text2.Value)*350000
 else
if .text1.value="Kelas 2"
 .text3.value=val(.text2.Value)*250000
 else 
if .text1.value="Kelas 3"
 .text3.value=val(.text2.Value)*100000 
endif
endif
endif
endif
endwith
Pada Command1  button (Proses) ketikan code SBB
with thisform
if val(.text2.value)>=10
 .text4.value="10%"
 .text5.value=val(.text3.text)-val(.text3.text)*0.1
 Else
if val(.text2.value)>=8
 .text4.value="5%"
 .text5.value=val(.text3.text)-val(.text3.text)*0.05
else
if val(.text2.value)<8
 .text4.value="0%"
 .text5.value=val(.text3.text)
endif
endif
endif
endwith                                     
Pada Command2  button (Clear) ketikan code SBB
with thisform
.text1.value=""
.text2.value=""
.text3.value=""
.text4.value=""
.text5.value=""
endwith
 Pada Command3  button (Exit) ketikan code SBB
thisform.release
0 komentar:
Posting Komentar