https://bugs.winehq.org/show_bug.cgi?id=53807
Bug ID: 53807 Summary: vbscript fails to redim original array in function when passed byref Product: Wine Version: 7.16 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: jsm174@gmail.com Distribution: ---
While working on leveraging the vbscript engine of Wine for a macos/linux port of Visual Pinball, I ran into a script that resizes an array in a function by passing the array in byref. When the function finishes, the array appears to be at the original size.
Take the following code:
dim ax redim ax(4)
Function Resize(byref x2) Wscript.Echo "IN RESIZE BEFORE: " & UBound(x2) Redim x2(20) Wscript.Echo "IN RESIZE AFTER: " & UBound(x2) End Function
Wscript.Echo "BEFORE: " & UBound(ax)
Resize ax
Wscript.Echo "AFTER: " & UBound(ax)
In wine VBS:
BEFORE: 4 IN RESIZE BEFORE: 4 IN RESIZE AFTER: 20 AFTER: 4
In real VBS:
BEFORE: 4 IN RESIZE BEFORE: 4 IN RESIZE AFTER: 20 AFTER: 20