# CODING METODE SIMPLEKS

Document Sample

```					CODING METODE SIMPLEKS

Private Sub Command1_Click()
txt_cb.Text = NK3
txt_pr.Text = NK2
End Sub

Private Sub DISS_Click()
'kolom pivot
If Int(X1A) < Int(X2A) Then
kk1 = X1A
KK2 = X1B
KK3 = X1C
KK4 = X1D
Label21.Caption = "CB"
VGANTI_BP = "CB"
Else
kk1 = X2A
KK2 = X2B
KK3 = X2C
KK4 = X2D
Label22.Caption = "PR"
VGANTI_BP = "PR"
End If

'mencari baris pivot
If KK2 = 0 Then
A=0
Else
A = NK2 / KK2
If KK3 = 0 Then
B=0
Else
B = NK3 / KK3
If KK4 = 0 Then
C=0
Else
C = NK4 / KK4

End If
End If
End If

'baris baru
If A < B And B < C And A < C Then
x=A
F = KK2
P = Z2 / F
Q = X1B / F
R = X2B / F
S = S1B / F
T = S2B / F
U = S3B / F
V = NK2 / F
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * S)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * S)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * S)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z2.Text = P
X1B.Text = Q
X2B.Text = R
S1B.Text = S
S2B.Text = T
S3B.Text = U
NK2.Text = V
s1_pr.Caption = VGANTI_BP
'menampilkan hasil akhir
If s1_pr.Caption = PR Then
txt_pr.Text = NK2
End If
'If a < b And b < c And a = c Then'
'tak mungkin'

ElseIf A < B And B > C And A > C Then
x=C
F = KK4
P = Z4 / F
Q = X1D / F
R = X2D / F
S = S1D / F
T = S2D / F
U = S3D / F
V = NK4 / F
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * S)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * S)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * S)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = P
X1D.Text = Q
X2D.Text = R
S1D.Text = S
S2D.Text = T
S3D.Text = U
NK4.Text = V
Label19.Caption = "CB"
ElseIf A < B And B > C And A < C Then
x=A
F = KK2
P = Z2 / F
Q = X1B / F
R = X2B / F
S = S1B / F
T = S2B / F
U = S3B / F
V = NK2 / F
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * S)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * S)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * S)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z2.Text = P
X1B.Text = Q
X2B.Text = R
S1B.Text = S
S2B.Text = T
S3B.Text = U
NK2.Text = V
s1_pr.Caption = VGANTI_BP

'menampilkan hasil akhir
If s1_pr.Caption = PR Then
txt_pr.Text = NK2
End If

'ElseIf a < B And B > c And a = c Then'
'tak mungkin'
'ElseIf a < b And b = c And a > c Then
'tak mungkin'
ElseIf A < B And B = C And A < C Then
x=A
F = KK2
P = Z2 / F
Q = X1B / F
R = X2B / F
S = S1B / F
T = S2B / F
U = S3B / F
V = NK2 / F
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * S)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * S)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)

Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * S)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z2.Text = P
X1B.Text = Q
X2B.Text = R
S1B.Text = S
S2B.Text = T
S3B.Text = U
NK2.Text = V
s1_pr.Caption = VGANTI_BP
'menampilkan hasil akhir
If s1_pr.Caption = PR Then
txt_pr.Text = NK2
End If
'ElseIf a < b And b = c And a = c Then
'tak mungkin'
ElseIf A > B And B < C And A > C Then
x=B
F = KK3
P = Z3 / F
Q = X1C / F
R = X2C / F
S = S1C / F
T = S2C / F
U = S3C / F
V = NK3 / F
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * S)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * S)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * S)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z3.Text = P
X1C.Text = Q
X2C.Text = R
S1C.Text = S
S2C.Text = T
S3C.Text = U
NK3.Text = V
s2_cb.Caption = VGANTI_BP
'manampilkan hasil aKhir
If s2_cb.Caption = CB Then
txt_cb.Text = NK3
End If
ElseIf A > B And B < C And A < C Then
x=B
F = KK3
P = Z3 / F
Q = X1C / F
R = X2C / F
S = S1C / F
T = S2C / F
U = S3C / F
V = NK3 / F
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * S)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * S)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * S)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z3.Text = P
X1C.Text = Q
X2C.Text = R
S1C.Text = S
S2C.Text = T
S3C.Text = U
NK3.Text = V
s2_cb.Caption = VGANTI_BP
'manampilkan hasil aKhir
If s2_cb.Caption = CB Then
txt_cb.Text = NK3
End If
ElseIf A > B And B < C And A = C Then
x=B
F = KK3
P = Z3 / F
Q = X1C / F
R = X2C / F
S = S1C / F
T = S2C / F
U = S3C / F
V = NK3 / F
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * S)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * S)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z4.Text = Z4 - (KK4 * P)
X1D.Text = X1D - (KK4 * Q)
X2D.Text = X2D - (KK4 * R)
S1D.Text = S1D - (KK4 * S)
S2D.Text = S2D - (KK4 * T)
S3D.Text = S3D - (KK4 * U)
NK4.Text = NK4 - (KK4 * V)
Z3.Text = P
X1C.Text = Q
X2C.Text = R
S1C.Text = S
S2C.Text = T
S3C.Text = U
NK3.Text = V
s2_cb.Caption = VGANTI_BP
'manampilkan hasil aKhir
If s2_cb.Caption = CB Then
txt_cb.Text = NK3
End If

ElseIf A > B And B > C And A > C Then
x=C
F = KK4
P = Z4 / F
Q = X1D / F
R = X2D / F
S = S1D / F
T = S2D / F
U = S3D / F
V = NK4 / F
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * S)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NK1 - (kk1 * V)
Z2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * S)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * S)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = P
X1D.Text = Q
X2D.Text = R
S1D.Text = S
S2D.Text = T
S3D.Text = U
NK4.Text = V
Label19.Caption = VGANTI_BP

'ElseIf a > b And b > c And a < c Then
'tak mungkin'
'/ElseIf a > b And b > c And a = c Then
'tak mungkin'
'ElseIf a > b And b = c And a > c Then
'tak mungkin'
'ElseIf a > b And b = c And a < c Then
'tak mungkin'
'ElseIf a > b And b = c And a = c Then
'tak mungkin'
'ElseIf a = b And b < c And a > c Then
'tak mungkin'
'ElseIf a = b And b < c And a < c Then
'tak mungkin'
'ElseIf a = b And b < c And a = c Then
'tak mungkin'
Else
If A = B And B > C And A > C Then
x=C
F = KK4
P = Z4 / F
Q = X1D / F
R = X2D / F
S = S1D / F
T = S2D / F
U = S3D / F
V = NK4 / F
Z1.Text = Z1 - (kk1 * P)
X1A.Text = X1A - (kk1 * Q)
X2A.Text = X2A - (kk1 * R)
S1A.Text = S1A - (kk1 * S)
S2A.Text = S2A - (kk1 * T)
S3A.Text = S3A - (kk1 * U)
NK1.Text = NKZ2.Text = Z2 - (KK2 * P)
X1B.Text = X1B - (KK2 * Q)
X2B.Text = X2B - (KK2 * R)
S1B.Text = S1B - (KK2 * S)
S2B.Text = S2B - (KK2 * T)
S3B.Text = S3B - (KK2 * U)
NK2.Text = NK2 - (KK2 * V)
Z3.Text = Z1 - (KK3 * P)
X1C.Text = X1C - (KK3 * Q)
X2C.Text = X2C - (KK3 * R)
S1C.Text = S1C - (KK3 * S)
S2C.Text = S2C - (KK3 * T)
S3C.Text = S3C - (KK3 * U)
NK3.Text = NK3 - (KK3 * V)
Z4.Text = P
X1D.Text = Q
X2D.Text = R
S1D.Text = S
S2D.Text = T
S3D.Text = U
NK4.Text = V
Label19.Caption = VGANTI_BP

'ElseIf a = b And b > c And a < c Then
'tak mungkin '
'ElseIf a = b And b > c And a = c Then
'tak mungkin'
'ElseIf a = b And b = c And a > c Then
'tak mungkin'
'ElseIf a = b And b = c And a < c Then
'tak mungkin'
'ElseIf a = b And b = c And a = c Then
'tak mungkin'
'end blok yang benar

End If

End If

End Sub

Private Sub HSL_Click()
Z1.Text = 1
Z2.Text = 0
Z3.Text = 0
Z4.Text = 0
X1A.Text = (CB * -1)
X1B.Text = CB1
X1C.Text = CB2
X1D.Text = CB3
X2A.Text = (PR * -1)
X2B.Text = PR1
X2C.Text = PR2
X2D.Text = PR3
S1A.Text = 0
S1B.Text = 1
S1C.Text = 0
S1D.Text = 0
S2A.Text = 0
S2B.Text = 0
S2C.Text = 1
S2D.Text = 0
S3A.Text = 0
S3B.Text = 0
S3C.Text = 0
S3D.Text = 1
NK1.Text = 0
NK2.Text = TOTAL1
NK3.Text = TOTAL2
NK4.Text = TOTAL3

End Sub

Private Sub KELUAR_Click()
End Sub

Private Sub ULANG_Click()
CB.Text = ""
PR.Text = ""
CB1.Text = ""
CB2.Text = ""
CB3.Text = ""
PR1.Text = ""
PR2.Text = ""
PR3.Text = ""
TOTAL1.Text = ""
TOTAL2.Text = ""
TOTAL3.Text = ""

End Sub

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 200 posted: 6/28/2010 language: Indonesian pages: 12