Fungsi Operator

Kamis, 10 April 2014
aqu lagi latian listing program fungsi #operator aritmatika buat tugas matakul #visual basic

ini dia listing nya,buat yang pengen tau,,, trus yang uda jago,makasi bgt klo berkenan mampir disini buat sharing :) cekidot :

Private Sub cmdand_Click()
If txtnilai1 = “true” And txtniali2 = ”true” Then
   txthasil = ”true”
ElseIf txtnilai1 = ”true” And txtnilai2 = ”false” Then
   txthasil = ”false”
If txtnilai1 = “true” And txtniali2 = ”false” Then
   txthasil = ”false”
ElseIf txtnilai1 = ”false” And txtnilai2 = ”true” Then
   txthasil = ”false”
Else
   txthasil = ”false”
End If
End Sub

Private Sub cmdbagi_Click()
txthasil = Val(txtnilai1.Text) / Val(txtnilai2.Text)
End Sub

Private Sub cmdbelahketupat_Click()
txthasil = Val(txtnilai1.Text) <> Val(txtnilai2.Text)
End Sub

Private Sub cmdkali_Click()
txthasil = Val(txtnilai1.Text) * Val(txtnilai2.Text)
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdkurang_Click()
txthasil = Val(txtnilai1.Text) - Val(txtnilai2.Text)
End Sub

Private Sub cmdkurangdari_Click()
txthasil = Val(txtnilai1.Text) < Val(txtnilai2.Text)
End Sub

Private Sub cmdlagi_Click()
txtnilai1 = ""
txtnilai2 = ""
txthasil = ""
txtnot = ""
txtnilai1.SetFocus
End Sub

Private Sub cmdlebihdari_Click()
txthasil = Val(txtnilai1.Text) > Val(txtnilai2.Text)
End Sub

Private Sub cmdmod_Click()
txthasil = Val(txtnilai1.Text) Mod Val(txtnilai2.Text)
End Sub

Private Sub cmdnot_Click()
If cmdnot = True Then
   txtnot = Not True
Else
   txtnot = Not False
End If
End Sub

Private Sub cmdor_Click()
If txtnilai1 = ”true” Or txtnilai2 = ”true” Then
   txthasil = ”true”
If txtnilai1 = ”true” Or txtnilai2 = ”false” Then
   txthasil = ”true”
If txtnilai1 = ”false” Or txtnilai2 = ”true” Then
   txthasil = ”true”
Else
   txthasil = ”false”
End If
End Sub

Private Sub cmdpanahkanan_Click()
txthasil = Val(txtnilai1.Text) >= Val(txtnilai2.Text)
End Sub

Private Sub cmdpanahkiri_Click()
txthasil = Val(txtnilai1.Text) <= Val(txtnilai2.Text)
End Sub

Private Sub cmdsamadengan_Click()
txthasil = Val(txtnilai1.Text) = Val(txtnilai2.Text)
End Sub

Private Sub cmdtambah_Click()
txthasil = Val(txtnilai1.Text) + Val(txtnilai2.Text)
End Sub



4 komentar on "Fungsi Operator"

Terimakasih banyak atas kunjungannya, semoga bermanfaat.
Silakan komentar dengan kalimat bijak, jangan tinggalkan link hidup agar blog ini tetap sehat, salam kenal😊

EMOTICON
Klik the button below to show emoticons and the its code
Hide Emoticon
Show Emoticon
:D
 
:)
 
:h
 
:a
 
:e
 
:f
 
:p
 
:v
 
:i
 
:j
 
:k
 
:(
 
:c
 
:n
 
:z
 
:g
 
:q
 
:r
 
:s
:t
 
:o
 
:x
 
:w
 
:m
 
:y
 
:b
 
:1
 
:2
 
:3
 
:4
 
:5
:6
 
:7
 
:8
 
:9