https://bugs.winehq.org/show_bug.cgi?id=57511
Bug ID: 57511 Summary: For loop where loop var is not defined throws error without context Product: Wine Version: 9.4 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: francisdb@gmail.com Distribution: ---
Dim d: d = Array(1,2,3,4,5) 'Dim i For i = 0 To UBound(d) Wscript.Echo d(i) Next
/opt/wine-devel/bin/wine cscript test.vbs 0120:fixme:vbscript:assign_ident throw exception 0120:fixme:wscript:ActiveScriptSite_OnScriptError ()
on error resume next Dim d: d = Array(1,2,3,4,5) 'Dim i For i = 0 To UBound(d) Wscript.Echo d(i) Next If Err.Number <> 0 Then Wscript.Echo "Loop Error: " & Err.Number & " - at " & Err.Source & ": " & Err.Description Err.Clear End If
/opt/wine-devel/bin/wine cscript test.vbs 0120:fixme:vbscript:assign_ident throw exception 0120:fixme:vbscript:do_icall L"i" not found 0120:fixme:vbscript:interp_incc ref.type is not REF_VAR Loop Error: -2147467259 - at :
https://bugs.winehq.org/show_bug.cgi?id=57511
francisdb francisdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|For loop where loop var is |vbscript: For loop where |not defined throws error |loop var is not defined |without context |throws error without | |context
https://bugs.winehq.org/show_bug.cgi?id=57511
--- Comment #1 from francisdb francisdb@gmail.com --- forgot the first line
Option explicit
https://bugs.winehq.org/show_bug.cgi?id=57511
--- Comment #2 from francisdb francisdb@gmail.com --- cscript test.vbs Microsoft (R) Windows Script Host Version 5.812 Copyright (C) Microsoft Corporation. All rights reserved.
C:\Users\franc\OneDrive\Bureaublad\test2.vbs(5, 1) Microsoft VBScript runtime error: Variable is undefined: 'i'
cscript test.vbs Microsoft (R) Windows Script Host Version 5.812 Copyright (C) Microsoft Corporation. All rights reserved.
Loop Error: 500 - at Microsoft VBScript runtime error: Variable is undefined