Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default ParamArray debug anomaly

"Alan Beban" wrote in message
...
Peter T wrote:
But that's the same non-anomaly as the last one :-)

it's the same as trying to do -
Redim arr(1 to 4, 1 to 4)
Typename(arr(1)) ' Subscript out of range

but could do -
TypeName(Application.Index(x(0), 1)) ' Variant()

which is where I came in!

Regards,
Peter T


I'm not sure how worthwile it is for me to be prolonging this thread,
but then not everything I do is worthwile :-)

The only thing that now remains that strikes me as anomalous is that the
Locals window seems to be indicating that x(0)(1) is a variable of the
Variant type, i.e., it shows

Expression Type
x Variant(0 to 0)
x(0) Variant/Variant/Variant(1 to 4, 1 to 4)
x(0)(1) Variant(1 to 4)

but that doesn't seem to be the case.

Regards,
Alan Beban


I still don't see any anomaly in attempts to reference x(0)(1) with Ubound,
typename, vartype (cos' it's a one row of a multi-row array), but curiously
I too am starting to see something odd in Locals. In particular an
inconsistency between looking at the same array in Locals vs Watch.

Sub test()
Dim a
Dim b()
Dim c(): ReDim c(1 To 4, 1 To 3) As Variant
Dim d: ReDim d(1 To 4, 1 To 3) As Variant

a = Range("a1:c4")
b = Range("a1:c4")
c = Range("a1:c4")
d = Range("a1:c4")
res = foo(a, b, c, d)

End Sub
Function foo(ParamArray x())
Dim y
Dim z()

y = x
z = x

End Function

Looking in Locals at x(0) and x(3) both show
Variant/Variant/Variant(1 to 4, 1 to 3)

However, looking at same in Watch, x(0) and x(3) both show
Variant/Variant(1 to 4, 1 to 3)

x(1) and x(2) show the Variant/Variant in both Locals and Watch

I also compared y & z in Locals vs Watch

Locals
y - Variant/Variant(0 to 3) ' as expected
z - Variant(0 to 3) ' as expected

Watch
y - Variant/Variant(0 to 3) ' as expected
z - Variant/Variant(0 to 3) ' NOT as expected

y(n) and z(n) are all Variant/Variant(1 to 4,1 to 3) in both Locals &
Watch, ie not quite same as some of the equivalents in x

Indeed odd, not sure any of this has any implications, probably not ?

I think we can put it down to a quirk !

Regards,
Peter T
















Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date anomaly HaoHoaMastercard Excel Discussion (Misc queries) 4 October 11th 07 08:05 PM
Sort anomaly supersheet Excel Worksheet Functions 0 August 28th 07 06:57 PM
ParamArray bugs? pinkfloydfan Excel Programming 7 May 30th 07 09:14 PM
Help with paramarray Jeremy Excel Programming 1 January 8th 07 03:48 PM
ParamArray Jim Chandler[_2_] Excel Programming 4 April 28th 04 03:28 PM


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"