jeden warunek, wiele zdarzeń
Próbuję dowiedzieć się, jak zrobić wiele zdarzeń za pomocą jednego warunku za pomocą .vbs. (Tutaj próbowałem użyć instrukcji case.) Czy istnieje takie polecenie, czy muszę przepisać polecenie dla każdej linii? (Ma to być wpisane w notatniku, dzięki temu, że zostało już aktywowane w poprzednich wierszach kodu.)
msgbox("I was woundering how old you are.")
age=inputbox("Type age here.",,"")
Select Case age
Case age>24
x=age-24
WshShell.SendKeys "I see you are "&x&" years older than me."
WshShell.SendKeys "{ENTER}"
Case age<24
x=24-age
WshShell.SendKeys "I see you are "&x&" years younger than me."
WshShell.SendKeys "{ENTER}"
Case age=24
WshShell.SendKeys "Wow were the same age!"
WshShell.SendKeys "{ENTER} "
End Select