Need some help with VBScript.
Instructions:
Do
Display Message
"Do you wish to Display all of the IP Addresses (Y/N) ..... "
Get User Response and assign it to variable ans
If ans isn't "Y" & ans isn't "y" & ans isn't "N" & ans isn't "n" Then
Beep Speaker Twice
Display Msg "Error, Y,y,N,n response Only!!!" & skip line
EndIf
Loop While ans isn't "Y" & ans isn't "y" & ans isn't "N" & ans isn't "n"
If ans is "Y" OR ans is "y" Then
skip line
For roomNum = 0 to 5
For compNum = 0 to 3
Display "The IP Address in Room " room+100 " for Computer "
computer+1 " is " ipAddress(room,computer)
EndFor
EndFor
EndIf
And here is my code: The issue is that no matter what character you enter when prompted to enter Y or N, is that it responds with the error message. Which is Error, Y,y,N,n Response Only!!!!. Any help with this I would greatly appreciate.
Do
WScript.StdOut.Write(" Do you wish to Display all of the IP Addresses (Y/N) ..... ")
ans = WScript.StdIn.Readline()
If ans <> Y AND ans <> y AND ans <> N AND ans <> n Then
WScript.StdOut.WriteLine(chr(7) & chr(7) & " Error, Y,y,N,n Response Only!!!!! " & vbCrlf)
End If
Loop While ans <> Y OR ans <> y OR ans <> N OR ans <> n
If ans = Y OR ans = y Then
WScript.StdIn.Read(1)
For room = 0 to 5
For computer = 0 to 3
WScript.StdOut.Write("The IP Address in Room " & room+100 & " for Computer " & computer+1 & _
"is" & ipAddress(room, computer))
Next
Next
End If
-
Jason Zalesky -
Thanks
{{ DiscussionBoard.errors[5920311].message }} -