문자를 입력했거나 번호가 울린 상태에서 예외를 잡으려면이 코드 줄을 사용해야하지만 숫자 데이터를 포착하지 않으려면 WHEN을 추가하십시오. 이제는 예외 오류를 사용하여 코드를 두 번 실행하지 않으려면 사례 문 앞에 사용하십시오. 사례 코드가 실행되면 이미 try catch에 의해 처리 된 명확한 txtbox가 실행됩니다. 그게 당신에게 명확하지만, 나는 그것을 이해합니다. 여기 부분의 코드입니다 ... 내가 할 싶은 것이코드를 두 번 실행하지 않으려면 이전 시도 잡기 예외를 사용합니까?
Try
'Integer Levels: intLvls is egual to the assigned text box, the first one from
'the top, this line of code allow the user input to be captured into a variable.
intLvls = txtBoxLvl.Text
Catch ex As Exception When IsNumeric(intLvls)
ErrTypeLetterFeild1()
Finally
analysingvalues1()
End Try
: 사용 루프를 예외 오류를 refencing 때까지 코드의 다음 부분을 실행하지 않도록 :
Private Sub analysingvalues1()
Do Until IsNumeric (ex As Exception)<------how do i do this???
Loop
경우 부분 코드의 :
Select Case intLvls
'User is prompt with the following label: lblLvl "Level of salespersons 1 - 4"
'to make a choice from 1 to 4 as available values.
Case 1 To 4
'This line regulates the range of acceptable values, first textbox: must be egual
'or higher than 1 and lower or egual to 4. Upon such rules a validation becomes
'correct and is directed to the isValidCalculation sub.
isValidCalculation()
Case Is < 1
ErrType1NumberRangeFeild()
Case Is > 4
ErrType1NumberRangeFeild()
Case Else
If txtBoxLvl.Text = "" Then
ErrTypeClear1()
Else
If Not IsNumeric(txtBoxLvl.Text) Then
ErrType1NumberRangeFeild()
Else
ErrTypeLetterFeild1()
ErrTypeClear1()
End If
End If
End Select 'Ending choices.
End Sub
당신의 도움을위한 Tks! 이 엄격한 옵션을 설정하면
'Option Strict On'을 코드 맨 위에 올리거나 프로젝트 속성에서 설정하십시오. intLvls의 유형은 무엇입니까? –