« first day (837 days earlier)      last day (2343 days later) » 

12:00 AM
Actually it cuts both ways - you can only replace the line if you convert it back to hex before re-writing it in the VBE.
 
RELOAD!
 
Huh. Fully supported by GoTo also.
 
[rubberduck-vba/Rubberduck] 2 opened issues. 1 closed issue. 4 issue comments.
[ShipsWithCannons/HasStackSTV] 9 commits. 1014 additions. 132 deletions.
[Zomis/Monopoly] 2 commits. 2 additions. 3 deletions.
 
    'Paste this into VBE
Sub foo()
  &hFFFFFFFF Beep
  &hFFFFFFFE Beep
  &hFFFFFFFD Beep: Beep
  &hFFFFFFFC Beep: Beep
End Sub

'and the VBE shows
Sub foo()
-1           Beep
-2           Beep
-3 Beep:           Beep
-4 Beep:           Beep
End Sub
Sub foo()
  On Error GoTo -1
  Err.Raise 1
  Beep
-1                    Beep
End Sub
19
Q: Difference between 'on error goto 0' and 'on error goto -1' -- VBA

sterlingalstonCan anyone find the difference between 'On error goto -1' and 'on error goto 0' in VBA? I've tried google and msdn, but I've had no luck.

 
Wouldn't that mean any RD code that makes changes to a line with a negative line number would cause a compiler error?
Yep. Extract method does a "number" on it:
Sub foo()
NewMethod
-2           Beep
-3 Beep:           Beep
-4 Beep:           Beep
End Sub
Private Sub NewMethod()
-1           Beep   'Expected line number or label...
End Sub
Speaking of which... Extract method could easily break code with any line numbers or labels in it.
 
12:13 AM
RD will either have to use the hex trick, or refuse to refactor?
 
Or break it.
 
Extract Method went out of its way to do things its own way.
Any other RD code ignores line numbers
They're not even in the lexer stream
hmm wait a sec.. no, that's not it
solution is to just break code with line numbers then. too F'n bad
use line labels ffs
 
Use structured programming ffs
 
I vote inspection for line number use.
It screws up Erl too:
Sub foo()
On Error Resume Next
-1                   Err.Raise 1
-2          Debug.Print Erl   '65535
End Sub
WTF - that's just a straight up unhandled overflow in runtime:
2
Sub foo()
            On Error Resume Next
12345678    Err.Raise 1
            Debug.Print Erl   '24910
End Sub
 
12:26 AM
LOL
 
1:15 AM
@Comintern this VBA bug is brought to you by The Rubberduckers
 
 
1 hour later…
2:57 AM
Speak of the devil (literally):
0
Q: An excel macro to automatically number and indent vba code

A AHave you ever had a need to debug excel macros where you would like to know the exact line number where a particular error has occurred? Would you like to create a custom error handler that can provide the exact line number where a particular error occurred? Well, although VBA has an inbuilt fu...

 
3:24 AM
yikes, way to kill one's SO rep
 
To be fair, I helped a bit. :-P
 
gosh, when you have a whole module of global constants and another of global variables....
 Public gloInTheDark
SubSub
 
This doesn't do anyone any favors. The real answer is to structure your code in a way that you don't have functions so long that you need line numbers to identify issues in error reports. Line numbers can create more problems than they can possibly solve. There's a reason why you don't see them in widespread use after about 1985 (the year, not the line number). — Comintern 13 secs ago
 
LOL!!!
oh man, he just posted ANOTHER answer!!
 
Yeah, I saw that. This is like watching a slow motion train-wreck. I've been watching for the real answer to his last question.
LOL!!! protected by Community♦ 2 mins ago
 
3:38 AM
> There are code vestiges from other other sources
BWAHAHAHA
I just custom-flagged it
let a mod educate the poor guy about self-answered posts on SO
 
The moral of this story is that if you're going to perform a spectacular rep self-destruction, make sure to post fast enough that @Community doesn't lock the question before your rep falls below 10.
 
ironically I got a random +10 on that one earlier today:
36
A: Implementing String.Format() in VB6

Mat's MugI couldn't find one anywhere, so I made my own: Public PADDING_CHAR As String Public Function StringFormat(format_string As String, ParamArray values()) As String 'VB6 implementation of .net String.Format(), slightly customized. 'Tested with Office 2010 VBA (x64) Dim return_value As St...

4 more and I'm officially a [badge:guru]!
huh, that's 3 now
 
Nice. The CR implementation looks a bit cleaner though.
 
that's the original :)
I wonder if they use it at all at my old job
 
Somewhere on an ancient hard drive I have a VB implementation of printf().
 
3:48 AM
ha!
 
I negged his other answer for good measure.
 
That one I could care less about. The one I need to dredge up is the Berkeley sockets class.
 
I have an IStorage and IStream class somewhere
 
FWIW I'm still getting random crashes despite rearranging the _Extension class
maybe I'm doing this wrong
 
You referring to the email from Carlos?
 
4:03 AM
..probably?
 
[retailcoder/Rubberduck] retailcoder pushed commit 21e8668a to next: tweaked entry/exit point
 
^ review?
I'm off to bed :-/
dynamic _ide;
 
Won't if (vbe != null) return true if it's still in the process of loading?
 
the dynamic thing is just an attempt at visualizing how VB6 can fit there
@Comintern in StartupComplete?
 
Yeah. The vbe object is coming from the Interop assembly, not COM. AFAIK the Interop can still return an object even if the COM server would normally be blocking.
No clue how to check to see if it's done loading though...
 
4:09 AM
that's... dafuq
 
It's the same type of issue as trying to dereference ThisWorkbook.Anything in Workbook_Open()
Since Application is the root of the object hierarchy, it has to return a valid reference before any of its children.
 
@Comintern I thought that was a possibility in OnConnection, but by some wild out-of-this-world assumption I presumed OnStartupComplete meant the startup was, well, completed. geez how broken is that darn API?
 
It's not the API - it's more likely related to how the VBE object builds itself.
If the ctor for VBE.Application doesn't do everything to build its children (which would actually be bad practice), it can return a VBE object that is still building its children.
 
...if I ever write an IDE, remind me to start loading any addins after my app instance is constructed ;-)
 
No sh*t.
It has to do partially with how STA threading works - requests for objects are handled by winprocs. So... if you don't want your application to block on COM requests, you cheat.
 
4:19 AM
hmm
 
Window messaging is async by design. So there really aren't that many decent alternatives.
 
feel free to leave notes on that commit, I gotta go :-/
 
Night. I gotta go too.
 
is the vbe passed byval? That's how, for example, an item is passed to Outlook.Application.ItemLoad
 
 
4 hours later…
9:33 AM
> Just a UI thing.

If I write a commit message, and then commit the change, and it goes through, it is irritating to have to delete said message before writing a new one.
 
 
1 hour later…
10:38 AM
> It's easy to copy/paste properties only to get the field and member names confused:

```vb
Option Explicit

Dim m_foo As String
Dim m_bar As Object

Private Sub class_initialize()
m_foo = ""
Set m_bar = Nothing
End Sub

Public Property Get Foo() As String
Foo = m_foo
End Property

Public Property Let Foo(expression As String)
'Stack Overflow...
Foo = expression
End Property

Public Property Get Bar() As Object
Set Bar = m_bar
End Property

Public Property
 
10:54 AM
> The value is passed in, but the value of simple types won't change

```vb
Option Explicit

Sub test()

Dim cls As Class1
Set cls = New Class1
Set cls.Bar = New Class1

cls.Foo = "FOO"
Debug.Print cls.Foo ' FOO
DoSomething cls.Foo '<--------- Problem: Passing a class getter as a byref argument
'cls.Foo remains unchanged
Debug.Print cls.Foo ' FOO

cls.Bar.Foo = "FOO"
Debug.Print cls.Bar.Foo ' FOO
DoSomethingElse cls.Bar
'cls.bar.foo is chan
 
11:41 AM
Make test for Class event procedures a case-insensitive test

Thunderframe added some tests!
Merge pull request #2246 from ThunderFrame/next

Make test for Class event procedures a case-insensitive test
[rubberduck-vba/Rubberduck] build for commit 39273ba5 on next: AppVeyor build succeeded
 
12:09 PM
Just a brief pop in to say hello to everyone, still here.
or nearby
Hoping all the best RD would could grow out of their nappies, Captain @Mat'sMug with ANTLR. :) Even if you become a guru by then.
catch ya all. soon. bye
 
Hi @PeterMTaylor!
 
12:25 PM
@Mat'sMug - I resent the Carlos email
 
1:11 PM
Awesome thanks!
 
 
3 hours later…
3:44 PM
> I have about 40 production workfile, about 500 macros and around 500-1000 workbooks.open commands in all of these combined.

My problem is as follows
no. your problem is as written above
2
 
Kaz
4:07 PM
@Mat'sMug Do they work in finance?
 
lol, no idea
 
4:46 PM
   [ComImport, Guid("B65AD801-ABAF-11D0-BB8B-00A0C90F2744")]
   internal interface IDTExtensibility2
   {
      void OnConnection([In, MarshalAs(UnmanagedType.IDispatch)] object Application, [In] ConnectMode ConnectMode, [In, MarshalAs(UnmanagedType.IDispatch)] object AddInInst, [In, MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] ref Array custom);

      void OnDisconnection([In] DisconnectMode RemoveMode, [In, MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] ref Array custom);
@Comintern ^^ do these attributes make this interface able to pass for any IDTExtensibility2 interface?
i.e. it's late-binding the host IDE?
> ComImport: indicates that the attributed type was previously defined in COM.
interesting
 
5:07 PM
Huh. I'm not entirely sure what the internal attribute is off the top of my head, but it should still be early binding.
 
meh, internal is just an access modifier
makes the interface, well, internal to the assembly
IOW it's like public as long as you're in the defining assembly
what I really wonder is what the purpose of m_addIn might be
     m_vbe = (VBClassicExtensibility.VBE)application;
     m_addIn = (VBClassicExtensibility.AddIn)addInInst;
     m_addIn.Object = this;
hmm
public partial class MZTools8 : IDTExtensibility2
should we be assigning _addin.Object = this as well?
I hate partial classes
 
5:25 PM
Isn't RD already implementing that with public class _Extension : IDTExtensibility2?
Is that in the OnConnection event?
What I'm curious about is why addInInst would be anything other than this.
 
@Comintern yes
@Comintern IDK, I'm only ever passing addininst to some lower-level code for creating the toolwindows - it's provided by OnConnect, I never realized its Object property had to be assigned
So MZ-specifics out, I'll have an entry point that behaves something like MZT
I think I might need to email Carlos about some of the stuff in the rest of the partial class
we'll just keep early-binding the VBE interface for now
He's got his own interfaces defined... if I could just get a hold of them... we could late-bind the IDE and make it work in VB6 I think
 
6:09 PM
hmm I consistently get an InvalidFunctionPointerDelegate when realoading after unloading, here:
        _oldWndProc = (User32.WndProc)Marshal.GetDelegateForFunctionPointer(_oldWndPointer, typeof(User32.WndProc));
in the RubberduckHooks ctor
but other than that...
no crash
clean exit
oops, jinxed it
dammit
 
[retailcoder/Rubberduck] retailcoder pushed commit 8ac768d9 to next: Tweaked entry point per MZT8's Connect.VBA.cs; still experiencing host app failure on shutdown.
 
6:47 PM
we need a shim
i.e. RD needs to run in its own AppDomain
the RCW's are created per AppDomain
so that will definitely help with stability
 
7:28 PM
0
Q: IDTExtensibility2 implementation for Rubberduck's entry point

Mat's MugHere is the new & improved Rubberduck 2.x entry point class, based on MZ-Tools 8.0's Connect.VBA implementation of the IDTExtensibility2 COM interface, graciously shared to the Rubberduck team by Mr. MZ-Tools himself, Carlos Quintero. The modifications made are not yet merged into the project's ...

 
 
1 hour later…
8:51 PM
So I'm not a bad person for uninstalling RubberDuck 2.x?
 
lol, not at all
it's tagged "pre-release" for a reason - there's a TON of work left to do still
it's mainly been released so we could have something beyond 1.4.3 to show the world where RD stands as a project
because 2.x is a completely different ball game
and it's only a beginning :)
I think we're in the right direction
 
It was awesome while it worked. I'm looking forward to the full release of v2.
Or even an update to the pre-release. Don't know why it suddenly stopped working completely for me...
 
9:13 PM
ugh, it just crashed on me again - seems the new entry point code doesn't change anything :(
 
Still thinking a shim will help?
 
9:24 PM
not at this point, but... it can't hurt, can it?
3 hours ago, by Mat's Mug
the RCW's are created per AppDomain
 
You're getting crashes on shutdown though, not startup?
 
yep
not saying shim will help with that though
although... could it?
 
I'm not sure. Part of me thinks it will simply crash in a different appdomain.
 
@Mat'sMug but can you start RD after VBE startup?
 
Good question...where that 2.x download again?
I'm getting crashes when I open the VB editor, even with a new blank workbook with no VBA.
where is that 2.x install file?
 
9:40 PM
@ThunderFrame now, yeah. I think. I mean, it does look very much like MZT's entry point
@ChrisB did you uninstall via control panel?
 
@ChrisB RD loads when the VBE is first opened (or the VBE/vbProject accessed by code triggered by an add-in or workbook event. IT doesn't matter whether the workbook has any VBA in it.
 
I think I uninstalled with Revo
 
@Mat'sMug Well, IIRC, being able to load RD on demand is a win?
 
^^^
 
Users that think Excel should exit gracefully can now at least only load RD when they need to start the debugger parse a project.
 
9:47 PM
@ThunderFrame yeah.... that's not going very well either
4 hours ago, by Mat's Mug
hmm I consistently get an InvalidFunctionPointerDelegate when realoading after unloading, here:
 
well, I can load after VBE startup running next.
 
my next, or the main repo's next?
 
main repo
 
@ChrisB I don't know what that is, but I doubt it knows which registry keys to remove..
 
oh, I thought you pushed to main
 
9:52 PM
@ThunderFrame nope
> The modifications made are not yet merged into the project's main repository at the time of this writing, but you can view it on commit 8ac768d9 in my own fork.
TTQW
won't be at work tomorrow, kids' tonsils removal operation - tomorrow's the big day!
 
twin tonsillectomy?
 
yep
Jell-O [making] party tonight!
I'll miss all that loud snoring
 
Where are RD's reg keys? I can't tell if they were all removed or if I'm looking in the wrong directory.
 
if you can't find 8D052AD8-BBD2-4C59-8DEC-F697CA1F8A66 anywhere, it's already a good sign
but the registration process (regasm.exe) creates a key for every COM-visible type, e.g. each toolwindow
if you uninstall with the installer / control panel, it knows to run regasm.exe to unregister everything
 
I guess I can reinstall and uninstall with the uninstaller to be sure it's complete.
 
10:04 PM
yep, that's a good idea :)
 
Where do I find the 2.x installer?
 
Thanks. Bookmarked this time.
 
you might want to bookmark this page instead though
so it won't be stale come next release ;-)
 
ok
 
10:19 PM
> As per [MSDN](https://msdn.microsoft.com/en-us/library/aa231021(v=vs.60).aspx):

> If you're going to invoke more than one property or method of an object in a collection, copy the object reference to a strongly typed object variable first. Using an object reference while it's still in a collection is slower than using it after placing it in a strongly typed object variable (for example, Dim woCurrent As WorkOrder), because the Collection object stores items in Variants. Object references in
 
10:53 PM
@Mat'sMug You mean they still do that??
Reminds me of how they used to remove appendixes indiscriminately. They aren't vital parts, but they are useful...
> Both are part of your immune system, similar to lymph nodes (the “glands” you can feel at the front of your neck). As part of the immune system, the tonsils fight infection; they are first line of defense in the throat, and when they are doing their job fighting infections, you get a sore throat. (kevinmd.com/blog/2011/08/tonsils.html)
Basically, you are going to be weakening their immune system...
 
@Hosch250 I'm not sure that there's a medical consensus on that. Chronic infections and inflammation aren't exactly healthy in general. Tonsils aren't exactly a spleen.
 
> Before we had antibiotics, removing the tonsils was one way to combat recurrent strep infections. As soon as penicillin, one of the first antibiotics, came along, though, we instantly had an effective nonsurgical treatment for strep tonsillitis.
And immediately below that, it says strep is still highly sensitive to penicillin.
And maybe you should figure out where they are getting infected. We stopped getting strep when we stopped going to the mall.
 
The problem with using antibiotics to treat chronic infections is that it increases the likelihood of creating a resistant strain.
 
Yeah, but if it was going to be an issue, it would have been by now.
TB became resistant within 50 years.
We've been treating strep with penicillin probably more or less since it was discovered.
 
11:00 PM
0
Q: Why is VBA.Collection.Count a method

ThunderFrameThe VBA Collection has 5 members, all of which are methods: Add, Count, Item, _NewEnum and Remove. Of the 5 members, the Count method looks like it could/should be a getter rather than a method. Is this a legacy of OOP/MS design from the early days of VB6? Did the designers of the Collection an...

 
@Hosch250 normally no, but theirs are abnormally large, it's medically warranted
 
MDR strep strains are already incredibly common.
 
Oh, the sleep apnea type?
 
@Hosch250 yep. and the snoring.. it's something to hear coming from two such little things =)
 
OK, won't argue against that.
But if it was for chronic strep, well, you should treat the cause for that, and not the symptom.
Gosh, I have a ton of school to do.
Midterms are coming up...
 
11:56 PM
tell me about it ...
I can't bring myself to do university stuff at all ....
 

« first day (837 days earlier)      last day (2343 days later) »