« first day (341 days earlier)      last day (2839 days later) » 
00:00 - 17:0017:00 - 00:00

5:00 PM
@FreeMan Look into TempVar
 
ah... that's about as big a stretch as I usually have to make.
 
It's a handy way to store things in Access.
Faster than a table, but if you're relying on a config..... idk. Might not be the best solution.
 
TempVar - interesting, I wasn't aware of that. Will look into it.
 
someone want to tell me if I am using String Builder inappropriately?
 
At the moment, I'm relying on one constant for the path, and need to split off dev & prod, so everything's an option on the table at the moment.
 
5:02 PM
@Lyle'sMug sure
 
I am changing someone else's code to create a new site
so don't yell at me for naming here...one step at a time
    mailMessage2.Append(txtAddr1.Text)
    mailMessage2.Append(" ")
    mailMessage2.Append(txtAddr2.Text)
    mailMessage2.Append(" ")
    mailMessage2.Append(ddlState.SelectedValue.ToString())
 
@Lyle'sMug StringBuilder works best in a loop.. this looks more like a job for String.Concat
@Hosch250 replacing the 1 with _view.Target.Selection.EndLine might fix it (or it might introduce more issues)
I'd start with that ;)
 
I tried replacing it with 10,000.
Didn't work :)
 
@Mat'sMug or leave it like this?
> emailMessage = emailMessage + txtAddr1.Text + " " + txtAddr2.Text + " " + TxtCity.Text + " " + ddlState.SelectedValue + " " + TxtZip.Text + "<br />"
I am adding to it based on some if/then statements.
 
in most cases _view.Target.Selection.StartLine will match _view.Target.Selection.EndLine, hence the 1 here. Oh wait, should be Selection.LineCount, not EndLine
 
5:08 PM
No luck - same problem.
 
whoa, wait a minute
 
Still same problem.
 
then break on line 233 and step through. the bug is in that area for sure
 
nevermind....
 
I did that so I would know what to do.
 
5:13 PM
I think @Lyle'sMug just had a conversation with himself and managed to fix his own issue.
I don't know whether to feel useful or used
 
So, doing it again.
 
I haven't fixed my issue yet.
 
:(
me neither...
 
@FreeMan I feel using, because @Mat'sMug is always having to walk me through fixing the bug.
 
I am trying to figure out the best way to use String.Concat, but I don't think it is going to work for me in this circumstance
 
5:14 PM
@Hosch250 meh, you'll catch on, then start teaching him stuff!
 
so, execution enters the if block and gets to line 236 right?
 
Umm, hold on.
 
I think I am going to leave the concatenation alone and work on the bigger issues first, maybe it will circle back
 
Yeah.
 
line 236 performs the replacement in the token stream - the token stream is likely correct (you'll need to confirm that).
 
5:16 PM
Then, it runs through to this if:
if (subStmtContext != null)
{
    lastTokenIndex = subStmtContext.argList().RPAREN().Symbol.TokenIndex;
}
Then this return:
 
the rest of the logic is trying to determine which part of the rewritten token stream to stick into the VBE
 
return targetModule.Rewriter.GetText(new Interval(firstTokenIndex, lastTokenIndex));
OK.
 
is that return value correct?
 
I don't know what it should be.
 
that should be the new signature
 
5:17 PM
OK.
Yes, the signature is fine - except it is on one line.
 
that's good.
it can't be on multiple lines, the parser doesn't even know what a line continuation token is
so.
 
Huh.
Maybe we should update the parser and kill the problem at the root?
 
the correct behavior for the refactoring, is to take a multiline signature, rename the target, and rewrite the signature on one line
@Hosch250 easier said than done.
 
Yeah, it does that, it just doesn't remove the second line.
So, what am I trying to do here, anyway?
Remove the other lines, or make it insert over multiple lines?
 
oh, here right?
 
5:20 PM
Yeah, something like that.
Is there a way we can just replace the variable name and leave everything as is?
 
no
 
Bother.
 
lol
notice everything except parameters is renamed with a regex
 
are there any good reasons to have an empty Catch?
 
@Lyle'sMug So it doesn't keep throwing?
That will eat the exception and just continue executing.
 
5:22 PM
Okay I will leave this one here.
 
@Lyle'sMug this is COM interop, accessing the buttons on a form designer - if anything goes boom, I don't want to crash my whole app
 
oh gosh I forgot this is VB for apps and not a .NET room
2
 
yeah well we're debugging Rubberduck lol
 
I just Followed your VB tools. I figured I might have a look at some of that stuff later
 
so @Hosch250 after line #123, you need to add logic that determines if the signature has multiple lines.
and to remove the excess ones
notice:
var argContext = (VBAParser.ArgContext)_view.Target.Context;
 
5:26 PM
newContent "Public Sub Foo(ByVal Var12 As Integer, ByVal Var2 As Integer)" string
 
looks good
 
Huh, it had a bunch of extra spaces in there.
 
Rubberduck Master is your Repo @Mat'sMug?
 
so _view.Target.Context is an ArgContext - you just need to get the parent to get the ArgsListContext, and from there you can tell on how many lines the signature is written
@Lyle'sMug yeah
 
can I butt in for a minute here
:)
 
5:28 PM
but you should only do that when _view.Target.DeclarationType is a DeclarationType.Parameter
if you wonder how the heck I know that you need to get the parent context and that that parent is an ArgsListContext, ..it's all in the grammar file, VBA.g4
 
Hmm, kind of hard to work with this without docs.
Yeah, I'm making a bit of progress.
 
if I want a copy, do I fork it or branch it? (RubberDuck)
 
Fork it.
So, I have this:
if (_view.Target.DeclarationType == DeclarationType.Parameter)
{
    var something = _view.Target.Context.Parent;
}
 
@Lyle'sMug for contributing, fork it. for using, download the latest release :)
fork the next branch
 
5:33 PM
Is that right so far?
(Beyond the atrocious name, that is.)
 
Forking!
 
something would be a ParserRuleContext or some other ANTLR base class for an IParseTree - you need to explicitly cast it to a VBAParser.ArgListContext
 
OK.
 
and argList would make a much better name ;)
 
5:35 PM
Yeah, will definitely rename before I submit it.
 
what issue are you guys working on?
 
I'm doing 446.
 
so, argList.Start has the line for the first token, and argList.Stop has the line for the last token
 
Thanks.
Now, I have a question.
 
but just call the .GetSelection() extension method on it instead. A Selection is easier to work with
 
5:37 PM
443 looks like fun, maybe I should check out the code when I get home tonight and see if I can't figure that part out.
 
Why in the world do you have both Start and start method?
 
that's the ANTLR API - I suspect they're exposing public fields. Avoid using those (the lowercase ones), they might properly encapsulate them in future versions.
@Lyle'sMug yeah, take down all the issues!
 
I still have to figure out GITHUB and getting it to work with my freebie version of VS2013 at home..... and then I have to figure out the code you guys have so far. and then I have to find where all that stuff is going on in the code....lol
I don't know Versioning control. I am a Novice.
 
@Hosch250 so, argList.GetSelection().LineCount will tell you on how many lines the original signature was written on, assuming the opening brace is on the same line as the method's name.
 
Thanks.
 
5:43 PM
if that's greater than 1, you need to delete argList.GetSelection().LineCount - 1 lines in the code module starting at the line immediately below the one you just replaced. An off-by-one error here will wipe out the entire signature and beautifully wreck the user's code ;)
 
@Lyle'sMug start with creating a new branch from the next branch. ;)
 
^^^
 
@RubberDuck ???
 
@RubberDuck TMLI5 ;)
 
@Mat'sMug If it is beautiful, surely they won't mind it?
 
5:45 PM
wait I think I am getting there, going to do it at work too....lol
 
YES!!!
The only problem: It inserts empty lines instead.
 
sounds like "it works!"
huh?
 
is there a naming scheme for branching and such?
 
you should be deleting lines, right?
 
I just replaced the hanging lines with empty lines for now.
 
5:46 PM
@Lyle'sMug we try to follow this model. nvie.com/posts/a-successful-git-branching-model
Not very successfully, but we try.
 
And, it only works when the variable renamed is on the top line :(
 
Branch name should say what it is you're trying to add or fix.
 
This is trickier than it looks.
 
@Hosch250 it always is
 
OK, it now deletes the lines, but still only works when the line we replace is the top line.
 
5:51 PM
@RubberDuck so "443" should be the Branch name.....lol jk
 
@Lyle'sMug eh.. it's your fork. If you really want to confuse yourself.... =;)-
 
try acquiring a target on the 2nd line; the ArgListContext should still be the same..
 
I called it "noReferences"
 
> Drink life as it comes. Straight. No chasers.
 
now I just need to hook it into VS2013 and then again at home, and then find the place to write the code.
 
5:52 PM
@Lyle'sMug I would have gone with TellMeWhenImUseless
 
@Mat'sMug you all have plenty to teach me, so I don't think that will be for a long time
 
the branch name I mean!
lol
 
Almost working!
 
but hey, I'm responsible for GrammarIsFun
 
Now, we are chasing a rare bird, so I have to leave.
 
5:53 PM
lol
 
See you later, hope to submit this tomorrow.
 
@Hosch250 commiiiiiiiiiit! :)
great!
 
think I figured it out!
later @Hosch250
Microsoft.Office.Core is giving me some issues
is this supposed to be 32-bit? my machine is 64-bit
 
You have Office installed right?
 
yeah
 
6:01 PM
Mine too, running office 64-bit
 
give me a second....
 
32-bit office has been a breeze though
 
I thought there was a location to set the target 32 or 64 bit in the project properties.
 
You'll need to manually add a registry key to get RD to run in debug. Let us know when you get there ;)
 
but it looks like it is set for any CPU
 
6:03 PM
Not working quite.
 
Yeah. Don't change that!
 
@Mat'sMug oh, that is what I am trying to do....
 
@Lyle'sMug running in debug config right?
Does it build?
 
yes it builds
wait
> 1>------ Build started: Project: Rubberduck.Parsing, Configuration: Debug Any CPU ------
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(2151,5): warning MSB3283: Cannot find wrapper assembly for type library "Microsoft.Office.Core". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit.
2>------ Build started: Project: Rubberduck, Configuration: Debug Any CPU ------
 
Run VS as Admin.
 
6:05 PM
@Lyle'sMug are you running 32 bit office, or 64 bit office? Your OS bitness doesn't matter.
 
@Hosch250 automatically always
 
verify references
(in all projects)
 
@RubberDuck Rubberduck doesn't like Microsoft.Office.Core
32-bit
 
IT WORKS!!!
2
It works on both the first and second variables.
 
awesome!
 
6:07 PM
@Lyle'sMug Then you need to target 32 or Any.
 
Now, I'm going to test it with 10 variables, and if it still works, I'll commit.
 
@RubberDuck where are we talking? everywhere I have seen so far says Any CPU
 
yes, leave Any CPU
 
Hmm. Okay then. Not it.
 
did you check the project references?
 
6:10 PM
What year do you have?
 
One bug.
Will submit and create issue.
 
@Hosch250 also test that it doesn't break other use cases
 
Office 2010, VS 2013
 
@Lyle'sMug same as mine
 
brb
 
6:12 PM
@Mat'sMug It shouldn't.
 
I know
 
if (_view.Target.DeclarationType != DeclarationType.Parameter)
{
    module.ReplaceLine(_view.Target.Selection.StartLine, newContent);
}
else
{
    module.ReplaceLine(argList.Start.Line, newContent);
    module.DeleteLines(argList.Start.Line + 1, lineNum - 1);
}
See, I just replace the first line and delete the rest.
The bug is something to do with caching, I am positive.
 
what's the bug?
(I'd revert that condition; prefer positiveness :)
there's no caching involved at that point...
 
I'm creating an issue.
 
[retailcoder/Rubberduck] Hosch250 pushed commit 2314eb08 to next: Fix issue 446
 
6:15 PM
I just pushed the commit to next.
 
did you try renaming a control on a multiline instruction to see if the change on line 243 was warranted?
there might be other repercussions here
 
Oh, no, I forgot about that.
I'll undo that.
 
figured it out
 
> that should have been on a separate commit. you might have uncovered another unreported bug right here :+1:
 
it wants 14.0 and not 12.0
 
6:19 PM
ok
 
> Say you have this code:

Public Sub Foo(ByVal Var1 As Integer, _
ByVal Var2 As Integer)

Debug.Print Var1
Debug.Print Var2

End Sub

If you rename Var1 to Var15, (example), then CTRL-Z twice to undo both renames, then rename Var2 to Var25, then the code becomes this:

Public Sub Foo(ByVal Var15 As Integer, ByVal Var25 As Integer)

Debug.Print Var1
Debug.Print Var25

End Sub
> this cast fails if _view.Target.DeclarationType isn't a Parameter
 
Whoops, will fix that too.
 
that's why I said you needed to test a few other known-to-work cases ;)
 
I don't know what to test :(
 
if you rename another declaration type, like a variable, I expect an InvalidCastException there
 
6:22 PM
Anyway, I just changed the scope of the variables, and put the 0 back in.
Testing now.
Huh, now it crashes.
Anyway, leaving now.
Will finish this later.
 
@Mat'sMug - maybe write up a little doc on what to do to get the project working with VS2013. Seems like both @Hosch250 and @Lyle'sMug went through similar issues. It should save you some chat time working it out each time...
 
> You need to Ctrl+Z more than twice to fully undo all changes to the code module. "Undo rename" isn't something that's currently a supported use case. This is native/normal behavior.
 
@FreeMan yeah yeah
;)
 
I am having issues with other references now
 
6:25 PM
did you download the required nuget packages?
 
@Mat'sMug you telling me that I should read the readme file....????
 
@Lyle'sMug what references are missing?
 
there are mismatched references.
 
6:28 PM
what does that mean?
 
Error 11 Assembly 'Microsoft.Office.Interop.Access, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' uses 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' which has a higher version than referenced assembly 'office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' c:\Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15\Microsoft.Office.Interop.Access.dll Rubberduck
 
@Lyle'sMug download the 2007 PIAs.
 
look in the solution tree, under each project there's a "references" folder - open it. then don't even try to build until all references have no yellow triangle
those are called PIA's for a reason..
 
the test project is the only one with failing references and they are the other 2 projects
but the one project built this time around, I switched from 15 to 14 on that specific reference
 
15.0 would fail on my machine as well...
 
6:31 PM
they built
 
There's a link to the 2007 PIA right there ^.
If we want it to run on older versions, that's the version we need to use.
 
@RubberDuck well then how the heck does it run on Office 97 then?
oh. it runs. doesn't mean it'll build in VS
 
I still have no idea how it works at all on 97 or 2003.
@Mat'sMug I think that might be it.
Not sure to be honest.
 
if the interfaces are compatible, COM might just happily go with it
.net is pickier
 
6:37 PM
@RubberDuck not sure I should do that on my work machine, I already have a special place in the hearts of the Network Services guys....lol
 
Oh. Well. Fair enough.
 
you're building RD on your work machine??
2
 
cough
 
lol
I wouldn't get anything done if I did that
@Lyle'sMug but seriously, the Office PIA's are just interop DLL's - they wouldn't interfere with anything.
if anything interferes with your work.... it's working on Rubberduck!
 
lol
 
6:42 PM
Yeah. Don't do that ^^
 
there is one guy I talk to in Network Services here in the office and we have a running joke about me getting work done.....lol
or lack thereof
I will try to take a look at it later at home.
 
@Lyle'sMug that doesn't make you look very good
 
I get work done, that's what makes it funny....
 
I just don't want RD to get you in trouble ;)
 
6:55 PM
I will keep it to break time and other downtime moments....lol
 
@Duga Do we need to add a blurb about NuGet packages?
 
nah, VS warns you about 'em
 
cool
 
> Next time please create a new branch instead of committing directly to "next" - that way you can make all necessary commits and tests and fixes, and then you can make a PR to get your dev branch merged into "next".
 
@Duga that way we can review the changes before they hit the next release
 
7:23 PM
@Mat'sMug Truth!
hasn't accomplished much since discovering RD...
 
@Hosch250 I think I misread #462. I'll take another look tonight, after I pull your changes
 
> Just to clarify. You have this:

Public Sub Foo(ByVal Var1 As Integer, _
ByVal Var2 As Integer)

Debug.Print Var1
Debug.Print Var2

End Sub

Rename `Var1` to `Var15`, then you get this:

Public Sub Foo(ByVal Var15 As Integer, ByVal Var2 As Integer)

Debug.Print Var15
Debug.Print Var2

End Sub

So far so good. Then you Ctrl+Z / undo the rename and get this:

Public Sub Foo(ByVal Var1 As Integer, ByVal Va
> Behavior confirmed in 1.3.0.1 release. Houston, we have a bug!
 
7:41 PM
@Duga that's a case
 
8:17 PM
never try to copy a site to another project and then rename it.... my master page has identity issues. and I can't fix it!!!!!!!!!!!
 
8:36 PM
0
Q: SQL + VBA Populating Data in Cell Range

Sagar SI currently have a code that is connecting to SQL database in VBA. The data is populating correctly as I would like however, I was wondering if there is a way to condense the code below. I have 4 different columns and 26 rows and I feel like if I go this route, I will be wasting a lot of time. I ...

 
8:55 PM
@Mat'sMug You still here?
@Lyle'sMug I may have an idea.
Open the RubberDuck Properties from the bottom of the Debug dropdown.
Remove the pre-build and post-build events, and see what happens.
 
9:07 PM
[retailcoder/Rubberduck] Hosch250 pushed commit 7ca9a000 to next: Update so it really should work now
 
@Duga LOL -
NVM, worked it out, Mat'sMug.
Put this back:
var content = module.get_Lines(_view.Target.Selection.StartLine, 1);
And re-did this better:
            if (_view.Target.DeclarationType == DeclarationType.Parameter)
            {
                var argList = (VBAParser.ArgListContext)_view.Target.Context.Parent;
                var lineNum = argList.GetSelection().LineCount;

                module.ReplaceLine(argList.Start.Line, newContent);
                module.DeleteLines(argList.Start.Line + 1, lineNum - 1);
            }
            else
            {
                module.ReplaceLine(_view.Target.Selection.StartLine, newContent);
 
 
@RubberDuck @Mat'sMug in case you're interested:
 
Ow, I got stung by a nettle or something on my leg an hour ago :(
 
@Hosch250 I will never know now.....I scrapped it and went back to my last changeset. but I branched this time, maybe I can do this whole VCS thing right this time
@Hosch250 what?!
 
9:15 PM
Yeah, tried to see a rare bird, which involved a walk through the woods.
Didn't see the bird, but got bit on my leg by a plant because I was wearing shorts.
Still hurting.
 
 
9:33 PM
good! feel free to close the issue, I'll pull your changes tonight, I have some changes to merge into next too.
 
10:19 PM
I just merged the main Rubberduck into my fork. I believe the main Rubberduck is alright, but if I did something, just blame me.
 
@Duga good luck with that one... you're not picking the easiest issues! ;-)
 
Really?
OK.
 
10:51 PM
This is making me mad.
I tried to switch to my repo instead of yours, and now Rubberduck can't load!
 
@Phrancis think this will scare him enough to stop the insanity?
0
A: SQL + VBA Populating Data in Cell Range

RubberDuckWhat you need is an ADODB.Command. It's the same query with different parameters, so you should use a parameterized query. Honestly, you should be using a parameterized query anyway. You have no idea what the user has put into those cells. This is a SQL Injection disaster waiting to happen. Let's...

 
@RubberDuck You need to find a way to include that xkcd comic in there somewhere!
I think right after Boom. There goes your entire database. Gone. Poof. Up in smoke. would be perfect
 
@Hosch250 the regasm.exe command registered the codebase at a specific location. You need to unregister the old location and register the new one... or locate the key in your registry and update it
 
I just completely cleaned my registry of everything Rubberduck, and it is still busted.
OK.
What is the command again?
 
> I'm not sure how much of this applies to Word or Access/PowerPoint documents.
 
11:02 PM
@Phrancis better?
 
Much ;D
Good answer BTW (unsurprisingly)
 
Thanks! There was some other stuff that I'm tired of repeating, so I didn't...
 
Nice catch on complimenting the way of handling transferring from recordset to worksheet
 
^^ yeah. It ...counter-balances ;)
 
NVM, found it.
 
11:06 PM
"I need to take things from a table, and put them into another table... I know, I'm going to loop over the tables!"
I have to give an accolade to @Mat'sMug for helping me think in set-based mentality. Remember that mug? That was my first question!
 
@Mat'sMug Thanks, it is loading fine again.
Which is a good thing because I might have quit if it didn't.
Can't be reinstalling Windows every night.
 
regedit >> Ctrl + F
Repeat as necessary.
 
@RubberDuck Yeah, but what a job.
 
Oh. I know...
New blog post up btw.
Iterate over a date range in VBA http://wp.me/p42nM1-6E
 
11:27 PM
Next is already at 1,075 commits
I blame ducky and megamerge
I really like the way you split the projects in the solution btw @RubberDuck
 
Oh. Thanks. Been meaning to do it for a while.
Partly did it to motivate me to finish Git Integration. It was a 2.0 kind of change.
 
I just deleted an empty Refactoring folder in Rubberduck
Also, I adjusted an if {} else { if {} else {} } into an if {} else if {} else {}
@Mat'sMug Quick question about some of your catches:
catch (Exception exception)
{
    Debug.Assert(false);
}
 
Wtf Mug? ^ lol
 
Do you really need to do catch (...)?
Can't you just do catch, and be done with it?
I am getting a zillion warnings, and I don't like warnings :(
 
11:43 PM
As a wild guess. It should probably be swallowing just COMException.
But it's just a wild guess.
Got a link?
 
CodeInspectionsToolbar.cs.
> warning CS0168: The variable 'exception' is declared but never used
> // I got ya! I got you all! You'll think twice before messing with Percival C. McLeach!
 
That ^?
I'm definitely thinking it should be catching COMException instead. Lots of interaction with the VBE there.
But I'm not certain why it is the way it is. There aren't any comments. cough
I thought the extension method took care of that...
 
I don't think it should catch any particular exception because the exception value isn't used.
 
Normally, I'd agree. But COMExceptions are a bit out of our control sometimes and it's better to not let them crash the program.
 
00:00 - 17:0017:00 - 00:00

« first day (341 days earlier)      last day (2839 days later) »