Справочник Жаркова по проектированию и программированию искусственного интеллекта. Том 5: Программирование искусственного интеллекта на Visual Basic (продолжение 1). Валерий Алексеевич ЖарковЧитать онлайн книгу.
Word_in.TextLength = 19 Then
If str(0) = "a" Then
Chr19.Text = "A"
End If
If str(1) = "a" Then
Chr18.Text = "A"
End If
If str(2) = "a" Then
Chr17.Text = "A"
End If
If str(3) = "a" Then
Chr16.Text = "A"
End If
If str(4) = "a" Then
Chr15.Text = "A"
End If
If str(5) = "a" Then
Chr14.Text = "A"
End If
If str(6) = "a" Then
Chr13.Text = "A"
End If
If str(7) = "a" Then
Chr12.Text = "A"
End If
If str(8) = "a" Then
Chr11.Text = "A"
End If
If str(9) = "a" Then
Chr10.Text = "A"
End If
If str(10) = "a" Then
Chr9.Text = "A"
End If
If str(11) = "a" Then
Chr8.Text = "A"
End If
If str(12) = "a" Then
Chr7.Text = "A"
End If
If str(13) = "a" Then
Chr6.Text = "A"
End If
If str(14) = "a" Then
Chr5.Text = "A"
End If
If str(15) = "a" Then
Chr4.Text = "A"
End If
If str(16) = "a" Then
Chr3.Text = "A"
End If
If str(17) = "a" Then
Chr2.Text = "A"
End If
If str(18) = "a" Then
Chr1.Text = "A"
End If
ElseIf Word_in.TextLength = 20 Then
If str(0) = "a" Then
Chr20.Text = "A"
End If
If str(1) = "a" Then
Chr19.Text = "A"
End If
If str(2) = "a" Then
Chr18.Text = "A"
End If
If str(3) = "a" Then
Chr17.Text = "A"
End If
If str(4) = "a" Then
Chr16.Text = "A"
End If
If str(5) = "a" Then
Chr15.Text = "A"
End If
If str(6) = "a" Then
Chr14.Text = "A"
End If
If str(7) = "a" Then
Chr13.Text = "A"
End If
If str(8) = "a" Then
Chr12.Text = "A"
End If
If str(9) = "a" Then
Chr11.Text = "A"
End If
If str(10) = "a" Then
Chr10.Text = "A"
End If
If str(11) = "a" Then
Chr9.Text = "A"
End If
If str(12) = "a" Then
Chr8.Text = "A"
End If
If str(13) = "a" Then
Chr7.Text = "A"
End If
If str(14) = "a" Then
Chr6.Text = "A"
End If
If str(15) = "a" Then
Chr5.Text = "A"
End If
If str(16) = "a" Then
Chr4.Text = "A"
End If
If str(17) = "a" Then
Chr3.Text = "A"
End If
If str(18) = "a" Then
Chr2.Text = "A"
End If
If str(19) = "a" Then
Chr1.Text = "A"
End If
End If
If InStr(Word_in.Text, "a", CompareMethod.Text) = 0 Then
If f_chr1.Text = "" Then
f_chr1.Text = "A"
ElseIf f_chr2.Text = "" Then
f_chr2.Text = "A"
ElseIf f_chr3.Text = "" Then
f_chr3.Text = "A"
ElseIf f_chr4.Text = "" Then
f_chr4.Text = "A"
ElseIf f_chr5.Text = "" Then
f_chr5.Text = "A"
ElseIf f_chr6.Text = "" Then
f_chr6.Text = "A"
ElseIf f_chr7.Text = "" Then
f_chr7.Text = "A"
ElseIf f_chr8.Text = "" Then
f_chr8.Text = "A"
ElseIf f_chr9.Text = "" Then
f_chr9.Text = "A"
ElseIf f_chr10.Text = "" Then
f_chr10.Text = "A"
ElseIf f_chr11.Text = "" Then
f_chr11.Text = "A"
End If
End If
End Sub
Дважды щёлкаем по кнопке Button с именем для 2-й буквы алфавита Name = B. Появившийся шаблон метода после записи нашего кода принимает следующий вид.
Листинг 19.3. Метод-обработчик щелчка кнопки.
Private Sub B_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles B.Click
B.Enabled = False
nums = Len(Word_in.Text)
Try
str(0) = Mid(Word_in.Text, nums, 1)
str(1) = Mid(Word_in.Text, nums – 1, 1)
str(2) = Mid(Word_in.Text, nums – 2, 1)
str(3) = Mid(Word_in.Text, nums – 3, 1)
str(4)