79223137

Date: 2024-11-25 13:05:11
Score: 0.5
Natty:
Report link

I don't know why others think VBS can't handle this.

On Error Resume Next
    strInput = Wscript.Arguments(0)
    If (Error.Num > 0) Then strInput = "No input"
On Error Goto 0

The final line is simply to restore normal error handling, of course.

This is basically the same idea as the C construct of Try.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: JoeM