Note that ReDim v(1) is abusing the ReDim statement as a dual runtime-declaration-and-array-resizing, which thwarts Option Explicit. I'd warmly recommend declaring Dim v() As String before the ReDim v(1). — Mathieu Guindon17 secs ago
skipped the "Rubberduck will soon be warning you about this" part :)
Yes - that's the static semantic from 5.4.3.3 that I quoted yesterday.
> If the name has no matches, then the <redim-statement> is instead interpreted as a <local-variable-declaration> with a <variable-declaration-list> declaring a resizable array with the specified name and the following rules do not apply.
Oh wait. That's a no, isn't it. If the first statement with that identifier is ReDim, it's treated just like a Dim for that identifier.
Public Sub doit()
Dim foo As Variant
ReDim foo(2) As Long
foo(0) = 1
foo(1) = 2
Debug.Print foo(0), foo(1)
ReDim foo(2) As String
foo(0) = "abc"
foo(1) = "def"
Debug.Print foo(0), foo(1)
End Sub
IDK if the specification says so (it's not clear to me in the quote ComIntern posted above) but if a Redim without Dim results in a implicit Variant declaration, that'd be what we should treat those variables then.
^ in the minds of pretty much anyone that types ReDim, the mental image is "the instruction lets me change the number of clusters in the array". here it's "the instruction lets me change the size of each cluster"
The documentation has always said that Redim Preserve will create a new array of the new size, then copy the old array into the new array, then deallocate the old array.
Sub example2()
Dim foo() As Long
ReDim foo(2)
foo(0) = 1
foo(1) = 2
Debug.Print VarPtr(foo(0))
Debug.Print VarPtr(foo(1))
ReDim Preserve foo(3)
Debug.Print VarPtr(foo(0))
Debug.Print VarPtr(foo(1))
Debug.Print VarPtr(foo(2))
End Sub
right because i'ts going though the referenced types
when it processes the individual types
umm. which makes the 2-pass option looks awful
hopefully we won't lose too much performance when we single thread it- I know you said it's fast. Just don't know how much of it is from multi-threading.
Right. I bet the picture looks much more worse for a project that references 4 Office application than a project that refrences 12 unrelated libraries.
There's also the idea to just serialize them, since the referenced library won't normally change that often.
then you don't have to worry about resolving the referenced libraries since that'll be all in there... right?
@Hosch250 This is lower level than the resolver. When the typelibs are being read, they can have arbitrary external imports, and that cache has a limited lifetime.
So currently, If I have a cached Excel ComProject, then load Word, reading the Word library later snakes off into mso and misses the cache.
It's still all in the declarations, but when it's reading the typelib it can't use those. I suppose it could if we were tracking GUIDs, but it would be pretty complicated.
Release date committed! November 25th will see Rubberduck v2.3.0 released... and writing #VBA code (oh, *and* #VB6 too!) will never be the same again!
Feature-freeze is in effect: excluding currently open pull requests, only bugfix PRs will be merged until then.
@this I've got a project that references Access, Excel, PPT & Outlook. That should do for some pain
> Based on your organization's access policies, access to this web site ( heaventools.com/overview.htm ) has been blocked because the web category "Freeware and Shareware" is not allowed
@Inarion Yeah, I use "send secure ..." in the subject line of emails to ensure it goes through the encrypted/secure server, and I get "Your email contained PHI data" responses. I never know whether that's a "Hey, our scanner actually managed to detect something this time" or if it's just a random response when using the secure server
used to work for a mid-size pharma company. nothing was blocked and, realistically, couldn't be... work for a hospital system now, darn near everything is blocked...
@Comintern When I interned part of the orientation was "be careful about what you search for" and " 'Dicks' Sporting Goods " was an example that actually occurred. #PineapplesDontThink
I wonder what the effects of, instead of your head spinning faster than your feet (real) vs the effects of your feet spinning faster than your head (artificial) would be?
Of course, the effect of real is almost non-existant because of scale.
But the artificial one would be pretty bad for at least the near future.
Right, but conservation of angular momentum would slow the rotation of the system as your center of mass moved closer to the center. Think spinning skaters and arms.
Dad: Here son, take this plastic bag as a space helmet. It protects your melon. Put it on and breathe deep
Son: :Bags head: :Breathes deep: :Passes out:
Dad: Ahhh I see you're coming to. How you feel?
Son: :mumble:
Dad: Told you it'd protect your head. New get back in there soldier!
I didn't usually fall off, though, much to my parents chagrin. I think they would've like it if their warnings about falling off would've taught me my lesson.
I feel an itch to do it, but I have a few things on my list I want to do get I to RD first, like caching the COM projects for user code and readding member attributes after a rewrite.
@Hosch250 You can start at the beginning. Or, you can start in the middle. When you don't know where to start or where you're going, it doesn't really matter, does it?