私はこの場合、ユーザーがデータを入力する必要があります。私が必要とするのは、ユーザが0より大きく100までの数字を入力できるようにすることです。たとえば、please enter number from 0 to 100
のようなメッセージを表示してから、その番号を入力する必要がある場所を再度表示します。ユーザーが100以上の金額を入力しないようにする方法
は例えば、端末内Console.Write("Español: ")
は次のとおりです。ユーザーは100以上に入る
Español: ' the user should enter the number here
場合は、これを表示する:
Please enter number from 0 to 100. Español: ' here enter the number again
私は次のコードのようにこれを行うに考えていましたIf ... Elseと一緒ですが、もっと良い方法がありますか?ここで
実際のコードです:だから
Sub Main()
Dim Español1 As Integer
Dim Matematicas1 As Integer
Dim Ciencias1 As Integer
Dim EstudiosSociales1 As Integer
Dim Ingles1 As Integer
Dim ArtesPlasticas1 As Integer
Dim ArtesIndustriales1 As Integer
Select Case Menu
Case 2
Console.Write("Ingrese las notas: ")
Console.ReadLine()
Console.Write("Español: ")
' I was thinking on doing this
If Console.ReadLine() >= 100 Then
Console.Write("La nota debe ser 100 o menos: ")
Español1 = Console.ReadLine()
Else
Español1 = Console.ReadLine()
End If
If Español1 = True Then
Console.Write("Matematicas: ")
Matematicas1 = Console.ReadLine()
End If
Console.Write("Ciencias: ")
Ciencias1 = Console.ReadLine()
Console.Write("Estudios Sociales: ")
EstudiosSociales1 = Console.ReadLine()
Console.Write("Ingles: ")
Ingles1 = Console.ReadLine()
Console.Write("Artes plasticas: ")
ArtesPlasticas1 = Console.ReadLine()
Console.Write("Artes Industriales: ")
ArtesIndustriales1 = Console.ReadLine()
Console.Clear()
End Select
End Sub
、任意の提案ですか?
これはvb.netタグですか? – lokusking
これはVBAではなく、VBだけです。 VBAではConsole.WriteLineなどは使用できません。 –
@BennoGrimm私はすでにそれを修正します。ありがとう! – NietzscheProgrammer