You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When passing an Array to another method ByRef As Variant then LBound/UBound do not work
To Reproduce
Module Test
PublicSub Main()
Dim arr() AsVariant
arr = Array(1, 2, 3)
MsgBox GetArrayLBound(arr)
End SubPublicFunction GetArrayLBound(ByRef arr AsVariant) AsLong
GetArrayLBound = LBound(arr)
End Function
End Module
Expected behavior
If used on an Array passed ByRef (Variant), the LBound should return 0 but instead returns something looking as a pointer.
Screenshots
Desktop (please complete the following information):
OS: Windows 10 Enterprise V1909
twinBASIC compiler v0.9.2720
Additional context
It seems like the same issue occurs if calling the function with any value not just arrays. For exampleMsgBox GetArrayLBound(1) should raise a runtime error (13 - type mismatch in VBA) but instead tB aborts execution.
Moreover, the same issue occurs in this code:
Module Test
PublicSub Main()
Dim v AsVariant
v = 1
MsgBox LBound(v)
End Sub
End Module
The text was updated successfully, but these errors were encountered:
Describe the bug
When passing an Array to another method ByRef As Variant then LBound/UBound do not work
To Reproduce
Expected behavior
If used on an Array passed ByRef (Variant), the
LBound
should return 0 but instead returns something looking as a pointer.Screenshots
Desktop (please complete the following information):
Additional context
It seems like the same issue occurs if calling the function with any value not just arrays. For example
MsgBox GetArrayLBound(1)
should raise a runtime error (13 - type mismatch in VBA) but instead tB aborts execution.Moreover, the same issue occurs in this code:
The text was updated successfully, but these errors were encountered: