Skip to content

Commit

Permalink
fix print privous return value in repl error
Browse files Browse the repository at this point in the history
  • Loading branch information
OldLiu001 committed Jul 8, 2023
1 parent b61c648 commit 96cda20
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 30 deletions.
7 changes: 4 additions & 3 deletions impls/vbs/step1_read_print.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ Sub REPL()
Dim strRes
On Error Resume Next
strRes = REP(strCode)
If strRes <> "" Then
WScript.Echo strRes
End If
If Err.Number <> 0 Then
'WScript.StdErr.WriteLine Err.Source + ": " + Err.Description
WScript.StdErr.WriteLine "Exception: " + Err.Description
Else
If strRes <> "" Then
WScript.Echo strRes
End If
End If
On Error Goto 0
Wend
Expand Down
7 changes: 4 additions & 3 deletions impls/vbs/step2_eval.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,13 @@ Sub REPL()
Dim strRes
On Error Resume Next
strRes = REP(strCode)
If strRes <> "" Then
WScript.Echo strRes
End If
If Err.Number <> 0 Then
'WScript.StdErr.WriteLine Err.Source + ": " + Err.Description
WScript.StdErr.WriteLine "Exception: " + Err.Description
Else
If strRes <> "" Then
WScript.Echo strRes
End If
End If
On Error Goto 0
Wend
Expand Down
7 changes: 4 additions & 3 deletions impls/vbs/step3_env.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ Sub REPL()
Dim strRes
On Error Resume Next
strRes = REP(strCode)
If strRes <> "" Then
WScript.Echo strRes
End If
If Err.Number <> 0 Then
'WScript.StdErr.WriteLine Err.Source + ": " + Err.Description
WScript.StdErr.WriteLine "Exception: " + Err.Description
Else
If strRes <> "" Then
WScript.Echo strRes
End If
End If
On Error Goto 0
Wend
Expand Down
7 changes: 4 additions & 3 deletions impls/vbs/step4_if_fn_do.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ Sub REPL()
Dim strRes
On Error Resume Next
strRes = REP(strCode)
If strRes <> "" Then
WScript.Echo strRes
End If
If Err.Number <> 0 Then
'WScript.StdErr.WriteLine Err.Source + ": " + Err.Description
WScript.StdErr.WriteLine "Exception: " + Err.Description
Else
If strRes <> "" Then
WScript.Echo strRes
End If
End If
On Error Goto 0
Wend
Expand Down
7 changes: 4 additions & 3 deletions impls/vbs/step5_tco.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ Sub REPL()
Dim strRes
On Error Resume Next
strRes = REP(strCode)
If strRes <> "" Then
WScript.Echo strRes
End If
If Err.Number <> 0 Then
'WScript.StdErr.WriteLine Err.Source + ": " + Err.Description
WScript.StdErr.WriteLine "Exception: " + Err.Description
Else
If strRes <> "" Then
WScript.Echo strRes
End If
End If
On Error Goto 0
Wend
Expand Down
7 changes: 4 additions & 3 deletions impls/vbs/step6_file.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,13 @@ Sub REPL()
Dim strRes
On Error Resume Next
strRes = REP(strCode)
If strRes <> "" Then
WScript.Echo strRes
End If
If Err.Number <> 0 Then
'WScript.StdErr.WriteLine Err.Source + ": " + Err.Description
WScript.StdErr.WriteLine "Exception: " + Err.Description
Else
If strRes <> "" Then
WScript.Echo strRes
End If
End If
On Error Goto 0
Wend
Expand Down
7 changes: 4 additions & 3 deletions impls/vbs/step7_quote.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,13 @@ Sub REPL()
Dim strRes
On Error Resume Next
strRes = REP(strCode)
If strRes <> "" Then
WScript.Echo strRes
End If
If Err.Number <> 0 Then
'WScript.StdErr.WriteLine Err.Source + ": " + Err.Description
WScript.StdErr.WriteLine "Exception: " + Err.Description
Else
If strRes <> "" Then
WScript.Echo strRes
End If
End If
On Error Goto 0
Wend
Expand Down
7 changes: 4 additions & 3 deletions impls/vbs/step8_macros.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,13 @@ Sub REPL()
Dim strRes
On Error Resume Next
strRes = REP(strCode)
If strRes <> "" Then
WScript.Echo strRes
End If
If Err.Number <> 0 Then
'WScript.StdErr.WriteLine Err.Source + ": " + Err.Description
WScript.StdErr.WriteLine "Exception: " + Err.Description
Else
If strRes <> "" Then
WScript.Echo strRes
End If
End If
On Error Goto 0
Wend
Expand Down
7 changes: 4 additions & 3 deletions impls/vbs/step9_try.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,6 @@ Sub REPL()
Dim strRes
On Error Resume Next
strRes = REP(strCode)
If strRes <> "" Then
WScript.Echo strRes
End If
If Err.Number <> 0 Then
If Err.Source = "MThrow" Then
'WScript.StdErr.WriteLine Err.Source + ": " + _
Expand All @@ -415,6 +412,10 @@ Sub REPL()
'WScript.StdErr.WriteLine Err.Source + ": " + Err.Description
WScript.StdErr.WriteLine "Exception: " + Err.Description
End If
Else
If strRes <> "" Then
WScript.Echo strRes
End If
End If
On Error Goto 0
Wend
Expand Down
7 changes: 4 additions & 3 deletions impls/vbs/stepA_mal.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,6 @@ Sub REPL()
Dim strRes
On Error Resume Next
strRes = REP(strCode)
If strRes <> "" Then
WScript.Echo strRes
End If
If Err.Number <> 0 Then
If Err.Source = "MThrow" Then
'WScript.StdErr.WriteLine Err.Source + ": " + _
Expand All @@ -416,6 +413,10 @@ Sub REPL()
'WScript.StdErr.WriteLine Err.Source + ": " + Err.Description
WScript.StdErr.WriteLine "Exception: " + Err.Description
End If
Else
If strRes <> "" Then
WScript.Echo strRes
End If
End If
On Error Goto 0
Wend
Expand Down

0 comments on commit 96cda20

Please sign in to comment.