Люди помогите со скриптом на vb:
\'General Declarations
Const RED = &HFF&
Const LIGHTBLUE = &HFFFF00
Const GREEN = &HFF00&
Const BLUE = &HFF0000
Const PINK = &HFF00FF
Dim LightState, CountNumber As Integer
Dim LoopNumber As String
Private Sub Form_Load()
LoopNumber = 0
CountNumber = 0
End Sub
Private Sub tmrLight_Timer()
Select Case LightState
Case LightState = 0
shpLight(0).FillColor = RED
shpLight(1).FillColor = BLUE
shpLight(2).FillColor = GREEN
shpLight(3).FillColor = LIGHTBLUE
shpLight(4).FillColor = PINK
tmrLight.Interval = 3000
LightState = 1
Case LightState = 1
shpLight(0).FillColor = PINK
shpLight(1).FillColor = RED
shpLight(2).FillColor = BLUE
shpLight(3).FillColor = GREEN
shpLight(4).FillColor = LIGHTBLUE
tmrLight.Interval = 3000
LightState = 2
Case LightState = 2
shpLight(0).FillColor = LIGHTBLUE
shpLight(1).FillColor = PINK
shpLight(2).FillColor = RED
shpLight(3).FillColor = BLUE
shpLight(4).FillColor = GREEN
tmrLight.Interval = 3000
LightState = 3
Case LightState = 3
shpLight(0).FillColor = GREEN
shpLight(1).FillColor = LIGHTBLUE
shpLight(2).FillColor = PINK
shpLight(3).FillColor = RED
shpLight(4).FillColor = BLUE
tmrLight.Interval = 3000
LightState = 4
Case LightState = 4
shpLight(0).FillColor = BLUE
shpLight(1).FillColor = GREEN
shpLight(2).FillColor = LIGHTBLUE
shpLight(3).FillColor = PINK
shpLight(4).FillColor = RED
tmrLight.Interval = 3000
LightState = 0
End Select
\'adding 1 to CountNumber
CountNumber = CountNumber + 1
\'checking if CountNumber is equal to the value in the LoopNumber string.
If CountNumber = LoopNumber Then
\'setting the Enabled property of the timer control to False
tmrLight.Enabled = False
\'setting the Text property of the txtCount text box control to the string value of
\'CountNumber
txtCount.Text = CountNumber
End If
End Sub
Private Sub txtPassword_Change()
Dim i As Integer
If txtPassword = "test" Then
\'change the BackColor of txtPassword to green
txtPassword.BackColor = GREEN
\'Refresh method to update the colour immediately
frmDisco.Refresh
\'set the Visible property of the txtPassword text box control to False
txtPassword.Visible = False
\'by using an InputBox$ function to output a prompt and obtain a string from the user
sString = InputBox$("Please enter the value specifies how many complete rotations of the colours will be executed")
\'placign the string in the variable LoopNumber
LoopNumber = sString
\'set the Visible property of each shape control to True
For i = 0 To 4
shpLight(i).Visible = True
Next
\'set the tmrLight Enabled property to True
tmrLight.Enabled = True
\'call the tmrLight_Timer sub procedure
Call tmrLight_Timer
End If
End Sub
Проблема выделена жирным, тоесть доходит до второго case и не сменивает цвет.
С условием не меня код.
Жду ответов.
С Уважением,
Алекс.