Sabtu, 18 Juli 2009

Read more...

Modul XI

Bukan Array :

Dim t1,t2,t3,t4,t5 as single
t1=171,5
t2=177,8
t3=165,5
t4=150,9
t5=164,3

Variabel array :
Dim Nilai (5) As Byte
Nilai(1) = 90
Nilai(2) = 70
Nilai(3) = 85
Nilai(4) = 95
Nilai(5) = 75

Penghitungan dimensi Pada Array :
Cth :
1. Rancang antar muka seperti berikut :

2. Ketikkan kode brikut,carannya klik double CMD Proses

Private Sub Command1_Click()
Dim I As Byte
For I = 1 To 20
List1.AddItem (I * 5)
Next I
End Sub

Hasilnnya seperti brikut.




Read more...

Modul X

Pengenalan Array

Array atau larik atau jajaran variabel atau bisa juga variabel berindex.
Array adalah variabel tunggal tapi dapat di isi nilai banyak.Tapi nilai dibedakan oleh variabel.
contoh :
Dim Nilai (5) As Byte
Nilai(1) = 90
Nilai(2) = 70
Nilai(3) = 85
Nilai(4) = 95
Nilai(5) = 75

Beda variabel biasa dengan Variabel array
Mis:Diinginkan menyimpan tinggi 5 orang Mahasiswa

variabel biasa :
Dim t1,t2,t3,t4,t5 as single
t1=171,5
t2=177,8
t3=165,5
t4=150,9
t5=164,3

'cai jumlah
Jumlah = t1+t2+t3+t4+t5
'cari rata
Rata = Jumlah /5


Variabel array :
Dim Nilai (5) As Byte
Nilai(1) = 90
Nilai(2) = 70
Nilai(3) = 85
Nilai(4) = 95
Nilai(5) = 75

'cari jumlah
Jumlah=0
Jumlah = Jumlah + Nilai(5)
Next I
'Cari rata
Rata = Jumlah/5



Read more...

Modul IX

1. Buat rancangan antar muka seperti berikut.


2. Duble klik CMD Proses
3. Ketikkan Program berikut :

Private Sub Command1_Click()
Dim nama As String
Dim TB, BB, BI, B As Single
nama = Text1.Text
TB = Val(Text2.Text)
BB = Val(Text3.Text)
BI = (TB - 110) * 1.1
If (BB > (1.1 * BI)) Then
Text4.Text = "Hallo " + nama + " Anda GEMUK juga yah..."
Else
If (BB < (0.9 * BI)) Then Text4.Text = "Hallo " + nama + " Anda KURUS Banget..."
Else
Text4.Text = "Hallo " + nama + " Anda IDEAL juga ternyata..."
End If
End If
End Sub

Private Sub Command2_Click()

Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""

End Sub
Private Sub Command3_Click()
MsgBox "apa ANDA yakin ingin keluar.?", vbOKCancel + vbQuestion, "KONFIRMASI"

End
End Sub

Private Sub Form_Load()
End Sub
4. Hasilnya Seperti Berikut

Read more...
script type=”text/javascript”> //form tags to omit in NS6+: var omitformtags=["input", "textarea", "select"] omitformtags=omitformtags.join(”|”) function disableselect(e){ if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1) return false } function reEnable(){ return true } if (typeof document.onselectstart!=”undefined”) document.onselectstart=new Function (”return false”) else{ document.onmousedown=disableselect document.onmouseup=reEnable }

  © Laporan Praktikum by pemerograman1.blogspot.com/ 2009

Back to TOP