Berikut ini adalah sintax dari program SPK (Sisten Pendukung Keputusan) dengan VB 6 :
Dim pertama(6) As Currency, a As Currency
Dim kedua(6) As Currency, b As Currency
Dim ketiga(6) As Currency, c As Currency
Dim keempat(6) As Currency, d As Currency
Dim satu, dua, tiga, empat, lima, enam As Currency
Dim terakhir(6) As Currency, akhir As Currency
Private Sub cmdkeluar_Click()
Unload Me
End Sub
Private Sub cmdbersih_Click()
On Error Resume Next
c1a.SetFocus
c1a.Text = ""
c2a.Text = ""
c3a.Text = ""
c4a.Text = ""
c1b.Text = ""
c2b.Text = ""
c3b.Text = ""
c4b.Text = ""
c1c.Text = ""
c2c.Text = ""
c3c.Text = ""
c4c.Text = ""
c1d.Text = ""
c2d.Text = ""
c3d.Text = ""
c4d.Text = ""
c1e.Text = ""
c2e.Text = ""
c3e.Text = ""
c4e.Text = ""
c1f.Text = ""
c2f.Text = ""
c3f.Text = ""
c4f.Text = ""
p1.Text = ""
p2.Text = ""
p3.Text = ""
p4.Text = ""
r1a.Text = ""
r2a.Text = ""
r3a.Text = ""
r4a.Text = ""
r1b.Text = ""
r2b.Text = ""
r3b.Text = ""
r4b.Text = ""
r1c.Text = ""
r2c.Text = ""
r3c.Text = ""
r4c.Text = ""
r1d.Text = ""
r2d.Text = ""
r3d.Text = ""
r4d.Text = ""
r1e.Text = ""
r2e.Text = ""
r3e.Text = ""
r4e.Text = ""
r1f.Text = ""
r2f.Text = ""
r3f.Text = ""
r4f.Text = ""
rc1.Text = ""
rc2.Text = ""
rc3.Text = ""
rc4.Text = ""
h1.Text = ""
h2.Text = ""
h3.Text = ""
h4.Text = ""
h5.Text = ""
h6.Text = ""
nama1.Text = ""
nama2.Text = ""
nama3.Text = ""
nama4.Text = ""
nama5.Text = ""
nama6.Text = ""
nm1.Caption = ""
nm2.Caption = ""
nm3.Caption = ""
nm4.Caption = ""
nm5.Caption = ""
nm6.Caption = ""
hasilnilai.Text = ""
gambar.Visible = False
End Sub
Private Sub cmdproses_Click()
pertama(0) = Val(c1a.Text)
pertama(1) = Val(c1b.Text)
pertama(2) = Val(c1c.Text)
pertama(3) = Val(c1d.Text)
pertama(4) = Val(c1e.Text)
pertama(5) = Val(c1f.Text)
pertamamaks = pertama(1)
For a = 0 To 5
If pertama(a) > pertamamaks Then pertamamaks = pertama(a)
Next
r1a.Text = Val(c1a.Text) / pertamamaks
r1b.Text = Val(c1b.Text) / pertamamaks
r1c.Text = Val(c1c.Text) / pertamamaks
r1d.Text = Val(c1d.Text) / pertamamaks
r1e.Text = Val(c1e.Text) / pertamamaks
r1f.Text = Val(c1f.Text) / pertamamaks
r1a.Text = Format((r1a.Text), "0.00")
r1b.Text = Format((r1b.Text), "0.00")
r1c.Text = Format((r1c.Text), "0.00")
r1d.Text = Format((r1d.Text), "0.00")
r1e.Text = Format((r1e.Text), "0.00")
r1f.Text = Format((r1f.Text), "0.00")
kedua(0) = Val(c2a.Text)
kedua(1) = Val(c2b.Text)
kedua(2) = Val(c2c.Text)
kedua(3) = Val(c2d.Text)
kedua(4) = Val(c2e.Text)
kedua(5) = Val(c2f.Text)
keduamaks = kedua(1)
For b = 0 To 5
If kedua(b) > keduamaks Then keduamaks = kedua(b)
Next
r2a.Text = Val(c2a.Text) / keduamaks
r2b.Text = Val(c2b.Text) / keduamaks
r2c.Text = Val(c2c.Text) / keduamaks
r2d.Text = Val(c2d.Text) / keduamaks
r2e.Text = Val(c2e.Text) / keduamaks
r2f.Text = Val(c2f.Text) / keduamaks
r2a.Text = Format((r2a.Text), "0.00")
r2b.Text = Format((r2b.Text), "0.00")
r2c.Text = Format((r2c.Text), "0.00")
r2d.Text = Format((r2d.Text), "0.00")
r2e.Text = Format((r2e.Text), "0.00")
r2f.Text = Format((r2f.Text), "0.00")
ketiga(0) = Val(c3a.Text)
ketiga(1) = Val(c3b.Text)
ketiga(2) = Val(c3c.Text)
ketiga(3) = Val(c3d.Text)
ketiga(4) = Val(c3e.Text)
ketiga(5) = Val(c3f.Text)
ketigamaks = ketiga(1)
For c = 0 To 5
If ketiga(c) > ketigamaks Then ketigamaks = ketiga(c)
Next
r3a.Text = Val(c3a.Text) / ketigamaks
r3b.Text = Val(c3b.Text) / ketigamaks
r3c.Text = Val(c3c.Text) / ketigamaks
r3d.Text = Val(c3d.Text) / ketigamaks
r3e.Text = Val(c3e.Text) / ketigamaks
r3f.Text = Val(c3f.Text) / ketigamaks
r3a.Text = Format((r3a.Text), "0.00")
r3b.Text = Format((r3b.Text), "0.00")
r3c.Text = Format((r3c.Text), "0.00")
r3d.Text = Format((r3d.Text), "0.00")
r3e.Text = Format((r3e.Text), "0.00")
r3f.Text = Format((r3f.Text), "0.00")
keempat(0) = Val(c4a.Text)
keempat(1) = Val(c4b.Text)
keempat(2) = Val(c4c.Text)
keempat(3) = Val(c4d.Text)
keempat(4) = Val(c4e.Text)
keempat(5) = Val(c4f.Text)
keempatmaks = keempat(1)
For d = 0 To 5
If keempat(d) > keempatmaks Then keempatmaks = keempat(d)
Next
r4a.Text = Val(c4a.Text) / keempatmaks
r4b.Text = Val(c4b.Text) / keempatmaks
r4c.Text = Val(c4c.Text) / keempatmaks
r4d.Text = Val(c4d.Text) / keempatmaks
r4e.Text = Val(c4e.Text) / keempatmaks
r4f.Text = Val(c4f.Text) / keempatmaks
r4a.Text = Format((r4a.Text), "0.00")
r4b.Text = Format((r4b.Text), "0.00")
r4c.Text = Format((r4c.Text), "0.00")
r4d.Text = Format((r4d.Text), "0.00")
r4e.Text = Format((r4e.Text), "0.00")
r4f.Text = Format((r4f.Text), "0.00")
satu
= (Val(r1a.Text) * Val(p1.Text)) + (Val(r2a.Text) * Val(p2.Text)) +
(Val(r3a.Text) * Val(p3.Text)) + (Val(r4a.Text) * Val(p4.Text))
dua =
(Val(r1b.Text) * Val(p1.Text)) + (Val(r2b.Text) * Val(p2.Text)) +
(Val(r3b.Text) * Val(p3.Text)) + (Val(r4b.Text) * Val(p4.Text))
tiga =
(Val(r1c.Text) * Val(p1.Text)) + (Val(r2c.Text) * Val(p2.Text)) +
(Val(r3c.Text) * Val(p3.Text)) + (Val(r4c.Text) * Val(p4.Text))
empat
= (Val(r1d.Text) * Val(p1.Text)) + (Val(r2d.Text) * Val(p2.Text)) +
(Val(r3d.Text) * Val(p3.Text)) + (Val(r4d.Text) * Val(p4.Text))
lima =
(Val(r1e.Text) * Val(p1.Text)) + (Val(r2e.Text) * Val(p2.Text)) +
(Val(r3e.Text) * Val(p3.Text)) + (Val(r4e.Text) * Val(p4.Text))
enam =
(Val(r1f.Text) * Val(p1.Text)) + (Val(r2f.Text) * Val(p2.Text)) +
(Val(r3f.Text) * Val(p3.Text)) + (Val(r4f.Text) * Val(p4.Text))
h1.Text = satu
h2.Text = dua
h3.Text = tiga
h4.Text = empat
h5.Text = lima
h6.Text = enam
terakhir(0) = Val(h1.Text)
terakhir(1) = Val(h2.Text)
terakhir(2) = Val(h3.Text)
terakhir(3) = Val(h4.Text)
terakhir(4) = Val(h5.Text)
terakhir(5) = Val(h6.Text)
h1.Text = Format((h1.Text), "0.000")
h2.Text = Format((h2.Text), "0.000")
h3.Text = Format((h3.Text), "0.000")
h4.Text = Format((h4.Text), "0.000")
h5.Text = Format((h5.Text), "0.000")
h6.Text = Format((h6.Text), "0.000")
terakhirmaks = terakhir(1)
For akhir = 0 To 5
If terakhir(akhir) > terakhirmaks Then terakhirmaks = terakhir(akhir)
Next
hasilnilai.Text = terakhirmaks
hasilnilai.Text = Format((hasilnilai.Text), "0.000")
gambar.Visible = True
End Sub
Private Sub Image1_Click()
makeTransparent Me.hWnd, 50
End Sub
Private Sub nama1_Change()
nm1.Caption = nama1.Text
End Sub
Private Sub nama1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub nama2_Change()
nm2.Caption = nama2.Text
End Sub
Private Sub nama2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub nama3_Change()
nm3.Caption = nama3.Text
End Sub
Private Sub nama3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub nama4_Change()
nm4.Caption = nama4.Text
End Sub
Private Sub nama4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub nama5_Change()
nm5.Caption = nama5.Text
End Sub
Private Sub nama5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub nama6_Change()
nm6.Caption = nama6.Text
End Sub
Private Sub c1a_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c2a_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c3a_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c4a_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c1b_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c2b_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c3b_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c4b_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c1c_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c2c_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c3c_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c4c_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c1d_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c2d_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c3d_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c4d_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c1e_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c2e_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c3e_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c4e_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c1f_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c2f_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c3f_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub c4f_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub nama6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub p1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub p2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub p3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub p4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Tidak ada komentar:
Posting Komentar