visual basic

VISUAL BASIC
operator aritmatika

^ = pangkat
* = kali
/ = bagi
\ = bagi,hasilnya dibulatkan kebawah
mod= sisa pembagian
+ = tambah
- = kurang

operator perbandingan
= (sama dengan)
<> (tidak sama dengan)
> (lebih besar)
>= (lebih besar sama dengan)
< (lebih kecil) <= (lebih kecil sama dengan) perintah perbandingan= IF kondisi then aksi contoh: Private Sub Command1_Click() Dim A As Integer Dim hasil As String A = Text1.Text If A < hasil = "bil.negatif"> 0 Then hasil = "bil.positif"
If A= 0 Then hasil = "ya nol"
Text2.Text = hasil
End Sub


Private Sub Command1_Click()
If Val(Text1.Text) < text = "bil.negatif"> 0 Then Text2.Text = "bil.positif"
If Val(Text1.Text) = 0 Then Text2.Text = "nol tauuuu"
End Sub




Private Sub Command1_Click()
If Val(Text1.Text) < text = "bil.negatif"> 0 Then Text2.Text = "bil.positif"
If Val(Text1.Text) = 0 Then
Text2.Text = "nol tauuuu"
Text2.Text = Text2.Text & "bukan negatif bukan pula positif"
End If


End Sub


Private Sub Command1_Click()
If Val(Text1.Text) <= 100 Then Text2.Text = "A" End If If Val(Text1.Text) <= 90 Then Text2.Text = "b" End If If Val(Text1.Text) <= 80 Then Text2.Text = "c" End If If Val(Text1.Text) <= 70 Then Text2.Text = "d" End If If Val(Text1.Text) <= 60 Then Text2.Text = "e" End If End Sub Private Sub Command1_Click() Dim Angka As Integer Angka = Text1.Text If Angka = 1 Then Text2.Text = "satu" ElseIf Angka = 2 Then Text2.Text = "dua" ElseIf Angka = 3 Then Text2.Text = "tiga" ElseIf Angka = 4 Then Text2.Text = "empat" ElseIf Angka = 5 Then Text2.Text = " 5 " Else Text2.Text = "harus angka 1-5" End Sub angka terbilang Private Sub Command1_Click() Dim angka As Integer angka = Text1.Text Select Case angka Case 1 Text2.Text = "satu" Case 2 Text2.Text = "dua" Case 3 Text2.Text = "tiga" Case 4 Text2.Text = "empat" Case 5 Text2.Text = "lima" Case Else Text2.Text = "harus angka 1-5" End Select End Sub perulangan Private Sub Form_Load() Dim I As Integer I = 1 While I <= 10 Text1.Text = Text1.Text & "hallo" & I Text2.Text = Text2.Text & "hallo" & I I = I + 1 Wend End Sub Private Sub Form_Load() Dim I As Integer I = 1 While I <= 5 Text1.Text = Text1.Text & I If I < text =" Text1.Text" i =" I" i =" 1" text =" Text2.Text" text =" Text2.Text" i =" 1" text =" Text3.Text" text =" Text3.Text" i =" I" i =" 5)" i =" 1" j ="I" kal =" kal" suku1 =" 1" suku2 =" 1" i =" 3" bil =" suku1" suku1 =" suku2" suku2 =" bil" bilangan =" 1" bilangan =" bilangan"> 9
End Sub



ilmubiner@gmail.com
ilmubiner.blogspot.com


1
222
33333
4444444

Private Sub Form_Load()
Text1.Text = ""
Dim ulang As Integer
ulang = 1
For I = 1 To 9
For z = 1 To 10 - I
Text1.Text = Text1.Text & " "
Next
For j = 1 To ulang
Text1.Text = Text1.Text & I
Next
Text1.Text = Text1.Text & vbCrLf
ulang = ulang + 2
Next
End Sub