Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

3.

PROGRAM DEKLARASI VARIABEL DAN OPERATOR LOGIKA

Setelah di RUN

RUMUS DEKLARASI VARIABEL DAN OPERATOR LOGIKA


Dim a As Integer Dim b As Integer Dim c As Integer Dim i As Single Private Sub and_Click() a = IIf(Txtkrktr_1.Text = "Benar", -1, 0) b = IIf(Txtkrktr_2.Text = "Benar", -1, 0) c = (a And b) lbland.Caption = Format(c, "True/False") End Sub Private Sub cmd_celesai_Click() pesan = MsgBox("Anda Yakin Ingin Keluar?", vbQuestion + vbYesNo) If pesan = vbYes Then Unload Me Else Load Me End If End Sub Private Sub Cmd_hapus_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Txtuts.Text = "" Txtuas.Text = ""

Txttgs.Text = "" Txtkhdrn.Text = "" hslakhir.Caption = "" SetFocus End Sub Private Sub Cmd_ulang_Click() Txtkrktr_1.Text = "" Txtkrktr_2.Text = "" lblor.Caption = "" lblnot.Caption = "" lbland.Caption = "" End Sub Private Sub Command1_Click() a = Text1.Text b = Text2.Text c = Text3.Text g = Text4.Text d = 0.3 * a Txtuts.Text = d e = 0.35 * b Txtuas.Text = e f = 0.25 * c Txttgs.Text = f h = 0.1 * g Txtkhdrn.Text = h End Sub Private Sub Command2_Click()

i = Txtuts.Text j = Txtuas.Text k = Txttgs.Text l = Txtkhdrn.Text m=i+j+k+l hslakhir.Caption = m End Sub Private Sub not_Click() lblnot.Caption = Format(c, "True/False") a = IIf(Txtkrktr_1.Text = "Benar", -1, 1) c = Not (a) End Sub Private Sub or_Click() a = IIf(Txtkrktr_1.Text = "Benar", -1, 0) b = IIf(Txtkrktr_2.Text = "Benar", -1, 1) c = (a Or b) lblor.Caption = Format(a, "True/False") End Sub Private Sub Timer1_Timer() Dim s As String s = Label5.Caption s = Mid(s, 2, Len(s) - 1) & Left(s, 1) Label5.Caption = s End Sub Private Sub Form_Load() lblwaktu.Caption = Format(Now, "DDDD, d MMMM yyyy hh:mm:ss") End Sub

Private Sub Timer2_Timer() lblwaktu.Caption = Format(Now, "DDDD,d MMMM yyyy hh:mm:ss") End Sub Private Sub Timer3_Timer() If Label12.Visible = True Then Label12.Visible = False Else Label12.Visible = True End If End Sub Private Sub Timer4_Timer() Dim s As String s = Label13.Caption s = Mid(s, 2, Len(s) - 1) & Left(s, 1) Label13.Caption = s End Sub

You might also like