« first day (342 days earlier)      last day (2838 days later) » 

12:00 AM
RELOAD!
[Cardshifter/Cardshifter] 1 opened issue. 12 issue comments.
[retailcoder/Rubberduck] 6 commits. 4 opened issues. 3 closed issues. 8 issue comments.
 
@RubberDuck Then just do a catch {}
 
But that's what I'm saying. It shouldn't be catching everything. Just ComException.
 
Oh, why?
We don't use the exception.
 
Because an uncaught COMException will crash RD entirely on occasion.
 
But we are catching it.
 
12:05 AM
Right, but we're also catching everything else.
 
Why shouldn't we?
Should we let those crash RD?
 
No. Those we have a decent chance of handling. Maybe.
 
OK.
 
Like I said though, @Mat'sMug would have to explain why he's catching everything there.
 
12:13 AM
@Mat'sMug So, it seems like all I need to do is change module.Name to module.[_CodeName], but it can't find _CodeName.
 
It's a hidden member
 
Also, not sure why, but module.Name and module.Parent.Name are the same.
Is that expected?
So, do I need to using Reflection, or something?
 
What type is module?
@Hosch250 that might work
 
A Microsoft.VBE.Interop.CodeModule.
var module = _view.Target.QualifiedName.QualifiedModuleName.Component.CodeModule;
Huh, it didn't help, and it says it expected an identifier.
 
As I said you didn't pick the easiest one - I don't know how to go about that one, and besides it seems to be renaming ThisWorkbook fine...
(and no I don't have a better explanation than that for the pokemon catchers)
 
12:18 AM
@Mat'sMug No it isn't.
It has exactly the problem stated in the linked answer.
 
Can you guys build next?
 
Yes.
 
Booting (actually, booting while making coffee and smoking a cigarette)
@Hosch250 ok I wasn't sure - when I tried it, it did rename it
*seem to
 
It renames it partially.
Just like in the answer.
 
@RubberDuck often it was just to break and debug.. and the catch-all survived somehow
 
12:23 AM
 
Nice
 
See, it tries to rename it, but it didn't work.
 
Not a huge priority though
 
Now I said I would do it, I have to.
 
[retailcoder/Rubberduck] ckuhn203 pushed commit b1e51728 to next: fixed build and broken references
 
12:27 AM
ThisWorkbook.[_CodeName] = "newName"
That works from within the VBE.
 
[retailcoder/Rubberduck] ckuhn203 deleted branch architectureChange
 
So now I need to translate it.
 
[retailcoder/Rubberduck] ckuhn203 deleted branch 1.22_hotfix
 
Gotta go. Didnt' get much done other than bringing my branch up to date.
 
@Hosch250 that's the part I haven't figured out ;)
 
12:30 AM
So, we are both in the same pickle.
 
It's in the properties collection.
3
Q: Change codename of worksheet with vba

DaveUThis code works fine with VBE window open, but raises an error Subscript out of range at this line: wB.VBProject.VBComponents(wS.CodeName).Properties("_CodeName").Value = "wsData" when VBE window is closed. Maybe someone can show me what I'm missing here. Sub newWorkbook() Dim wB As Workbo...

 
oh wow, nice one!
 
My google-fu is strong.
 
@RubberDuck I know, it is property number 13.
My debugging skills are strong.
Lol.
Anyway, I found it in the module.Parent.Properties at index 13.
 
See if you can't access it by its "name". I wouldn't rely on the index if we don't have to.
 
12:39 AM
I think renaming a worksheet "just works" the way we have it now. You'll have to hard-code ThisWorkbook somewhere. And I wouldn't assume all versions of office have that property at index 13
@RubberDuck great minds think alike I see ;)
 
I wouldn't be surprised.
Yeah.
 
It's Microsoft after all!
 
Quack!
 
@Mat'sMug My sister loves saying that about various things.
YES!!!!!!!
It WORKS!!!!
module.Parent.Properties.Item("_CodeName").Value = (object)_view.NewName;
@Mat'sMug Does this method do anything else?
 
which method?
 
12:42 AM
RenameModule()
Look, it changed it in both places!
 
it's used for renaming any Declaration that has a DeclarationType of DeclarationType.Module and possibly DeclarationType.Class, so that includes standard modules (.bas), and (if .Class is also involved) class modules (.cls) and user forms (.frm), ...and RD Declarations treat ThisWorkbook and worksheets as classes, too (which they are).
 
Huh.
Won't create pull request just yet.
 
> It should apply in theory. Definitely needs tested on other host apps.
 
Is there a set of tests I can run?
Works on Word.
 
if you can write one. you see writing unit tests for the RenamePresenter was done (thanks to @PetLahev), but I had to comment everything out when I introduced the TokenStreamRewriter dependency.
 
12:47 AM
Something busted in PowerPoint.
Rubberduck loads in Access, but doesn't appear to do anything.
Anyway, so it works in Word and Excel.
Renaming sheets in Excel still works.
OK, renaming a class module fails.
So, we need a different one for class modules.
 
make sure the Component.Type is vbext_ct_Document
 
Probably the previous.
OK.
 
I mean, the _CodeName only applies to document-type classes
 
Yeah, I got it.
It is working on class modules again.
So, I'll test the other two types quick, and PR.
Rename doesn't even open on UserForm types.
But it works on class modules and modules.
 
it should work on forms
1.3.0.1 works on forms
 
12:57 AM
Huh.
I'll comment out what I just did and see if it makes a difference.
I don't think it should, but you never know.
Nope, my changes didn't break it.
 
try adding a new form, and then put Set myform = New UserForm1 in a dummy procedure; then right-click/rename UserForm1. nothing?
 
That worked halfway, like before.
It didn't really change the deep name of the form, just partially changed it.
 
what do you mean?
 
OK, uncommenting my changes.
Testing again.
 
> I tried to use the codes below -- drives me nuts
 
1:03 AM
Still didn't work.
See how it doesn't change the name in both places.
OK, pushing this, and will work on that.
 
oh interesting..
thanks!
 
You can merge when you are ready.
 
\[[**retailcoder/Rubberduck**](https://github.com/retailcoder/Rubberduck)\] [**Hosch250**](https://github.com/Hosch250) pushed commit [**757e0646**](https://github.com/retailcoder/Rubberduck/commit/757e0646c22990c9d2a9d78f73ce00ed5d46a759) to [**next**](https://github.com/retailcoder/Rubberduck/tree/next): Merge pull request #1 from retailcoder/next

Next
 
looks good
 
1:07 AM
[retailcoder/Rubberduck] Hosch250 pushed commit 9d8c114b to next: Fix issue 358
[retailcoder/Rubberduck] Hosch250 pushed commit fb54a0d8 to next: Fix module rename process
 
@Mat'sMug Bad as rolfl.
 
\[[**retailcoder/Rubberduck**](https://github.com/retailcoder/Rubberduck)\] [**retailcoder**](https://github.com/retailcoder) pushed commit [**2c8f6bea**](https://github.com/retailcoder/Rubberduck/commit/2c8f6bea6566430f0b58cff70d05a2dc9b0fe4d4) to [**next**](https://github.com/retailcoder/Rubberduck/tree/next): Merge pull request #463 from Hosch250/next

Partial fix for issue 358
 
haha
 
tip: if you refer to an issue (like "#358") in a commit comment, the issue will link to the commit
the "#" makes the difference ;)
I don't think it gets any clearer than that:
            // identifiers used inside selection and before selection are candidates for parameters:
            var input = inScopeDeclarations.Where(item =>
                usedInSelection.Contains(item) && usedBeforeSelection.Contains(item)).ToList();

            // identifiers used inside selection and after selection are candidates for return values:
            var output = inScopeDeclarations.Where(item =>
                usedInSelection.Contains(item) && usedAfterSelection.Contains(item)).ToList();
@RubberDuck ^^ clean-linq?
 
1:12 AM
I didn't want to link yet.
But, I can't fix it.
I looked through the Object Browser, like the guy in the answer said, and there is no non-readonly name value.
 
linking doesn't automatically close the issue
 
Oh, OK.
 
for forms?
 
Exactly.
 
wtf
 
1:13 AM
Test it yourself.
You need to right-click in the members-of pane and activate hidden values too.
 
sure will... the minute I'm done cleaning up that ExtractMethodPresenter :)
 
Drat, I reverted my cleaned-up if.
Submit that in a sec, just so I don't do it anymore.
 
I closed that issue because UserForms aren't mentioned.
 
perfect
 
1:16 AM
If you want, you can reopen/edit it or create a new one.
 
make another for forms, just so it's documented - could be linked to #358
 
Feels good to close two issues in one day (with your guys' help).
 
[retailcoder/Rubberduck] Hosch250 pushed commit 4a916af2 to next: Cleaned-up if/else block
\[[**retailcoder/Rubberduck**](https://github.com/retailcoder/Rubberduck)\] [**retailcoder**](https://github.com/retailcoder) pushed commit [**692ece00**](https://github.com/retailcoder/Rubberduck/commit/692ece00597a3fb06116fac0c69297faf75b3b01) to [**next**](https://github.com/retailcoder/Rubberduck/tree/next): Merge pull request #465 from Hosch250/next

Cleaned-up if/else block
> Good catch
 
@Hosch250 wait 'till you're more comfortable with the code base, that issue list will melt!
 
1:22 AM
But, I did do the second mostly by myself, didn't I?
But, for each one I closed, I created another.
The second isn't so bad as the first.
 
@Hosch250 you did
@Hosch250 I do that all the time, too ;)
it has to be a member property as well
 
Huh?
It is.
At least, if we are talking about the same thing.
UserForms type is: vbext_ComponentType.vbext_ct_MSForm
I learned that with the debugger.
 
yeah it has its own component type - I meant for the Name property
 
> You mean in a simple Tree like VS, with just the line of code being changed?
 
1:27 AM
Name is a property, but is readonly.
It doesn't have a CodeName or _CodeName property.
 
This one should be a bit of a challenge, which I'm feeling up to right now.
 
that's a pretty complex one
does VS have that refactoring built-in?
 
Yes.
I do it occasionally.
 
ok
 
1:30 AM
Once I get this working, I'll build Remove Parameters on top of it, instead of vice-versa.
 
huh?
 
ah
 
1:31 AM
Whoops, assigned the wrong one.
 
ok
if you need help with the UI, let me know; I want all dialogs to be consistent throughout the application, so feel free to look at the other dialogs in the UI namespace
 
Of course.
 
basically I copy the top and bottom panels from another dialog, any time I make a new one ;)
 
Sure.
 
I need to tweak the ones Chris did for the source control feature
@Duga I'm not sure how the native VS UI looks like; I'm basing my UI on R# :/
 
1:35 AM
Want a screenshot?
Bug report:
 
basically if all usages are in the same scope, no need for a UI; if there's only the declaration to rename, no need for a UI; otherwise, yeah it's a treeview, with checkboxes so user can pick which references to rename or not
 
I took this:
Public Sub Foo(ByVal Var1 As Integer, _
               ByVal Var2 As Integer)

    Debug.Print Var1
    Debug.Print Var2

End Sub
And extracted a method:
And got this:
Private Sub Method1(ByVal Var1 As Integer)

    Debug.Print Var1
    Debug.Print Var2
End Sub
Where is Var2 going to come from, I'd like to know? Thin air?
 
that's entirely rewritten here, hold on...
building
 
I am using next.
Maybe you didn't push it yet?
 
I didn't even commit it yet
 
1:39 AM
OK, ok.
 
wait, no I committed parts of it, but I'm working in a dev branch
you should do that too
if your next is all up-to-date, then create a new branch out of it
 
I'm working in Hosch250/next.
 
yes, that's what I'm saying
 
OK.
 
I'm working in GrammarIsFun
so when I push, I don't affect next
we want to keep next as stable as possible
oh wow, good catch.
Private Sub Method1()

    Debug.Print Var1
    Debug.Print Var2
End Sub
even better!
I think the bug is in the Selection.Contains(Selection) extension method
 
1:50 AM
OK, creating an issue, because I found it.
Or don't we need one?
 
> I took this:

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

Debug.Print Var1
Debug.Print Var2

End Sub

And extracted a method, and go this:

Private Sub Method1(ByVal Var1 As Integer)

Debug.Print Var1
Debug.Print Var2
End Sub
 
that'll be the shortest-lived issue!
Public Sub Foo(ByVal Var1 As Integer, _
               ByVal Var2 As Integer)

    Method1 Var1, Var2
End Sub


Private Sub Method1(ByVal Var1 As Integer, ByVal Var2 As Integer)

    Debug.Print Var1
    Debug.Print Var2
End Sub
 
Great!
 
the only thing I'm unsure is this now:
            // identifiers used inside selection /*and before selection*/ are candidates for parameters:
            var input = inScopeDeclarations.Where(item =>
                _usedInSelection.Contains(item) /*&& _usedBeforeSelection.Contains(item)*/).ToList();
but it seems to work fine
 
1:55 AM
We can test later.
 
I have my FizzBuzz loop for testing, hold on ...
problem
Private Function Method1(ByVal fizz As Integer, ByVal buzz As Integer, ByVal value As Integer) As String
    Const fizz As Integer = 3
    Const buzz As Integer = 5
        If value Mod (fizz * buzz) = 0 Then
            result = "FIZZBUZZ"
        ElseIf value Mod fizz = 0 Then
            result = "FIZZ"
        ElseIf value Mod buzz = 0 Then
            result = "BUZZ"
        Else
            result = value
        End If
    Method1 = result
End Function
 
Well, what I do is run basic tests, commit, run extensive tests, and commit again.
When I know what to test, that is.
Method1 = result
Why aren't you returning that?
 
Public Sub FizzBuzz()

    Const fizz As Integer = 3
    Const buzz As Integer = 5

    Dim result As String
    Dim value As Integer
    For value = 1 To 100

        result = Method1(fizz, buzz, value)
        Debug.Print result

    Next

End Sub
@Hosch250 that's how a function returns its value in VBA
 
Weird and weirder.
My computer is telling me to reboot and install updates, BRB.
 
2:20 AM
I think Extract Method works perfectly now
 
Commit it then!
 
oh, and about the empty Refactorings folder... fine, remove it. but I really hope it comes back eventually; I don't like having all the refactoring logic in presenters - at one point I want refactorings to implement some IRefactoring interface, with a void Refactor(Selection) method so that code inspection quickfixes can call them.
 
Sure, create it when we need it.
This always cracks me up:
> You're all set—the retailcoder:next branch can be safely deleted.
Whenever I pull-request and merge your branch into my fork.
 
lol
see, even GitHub thinks you're working off a dev branch ;)
 
Well, I am now.
Anyway, now I need to make the form.
I hope forms are similar to WPF.
Because WPF is the future, the last forms are probably going to be going out with Universal apps coming in.
 
2:34 AM
[retailcoder/Rubberduck] retailcoder pushed commit 542a45e0 to GrammarIsFun: fixed bug in Selection.Contains extension method
[retailcoder/Rubberduck] retailcoder pushed commit d819d77c to GrammarIsFun: Finished rewriting ExtractMethodPresenter. Closes #466, tentatively closes #461 and #445.
 
YES!!!!!
 
[retailcoder/Rubberduck] retailcoder pushed commit 58f17938 to GrammarIsFun: Removed unused types mootinated by ExtractMethod rewrite.
 
> Semester Research Paper A (46.00) 0–50 92.00 %
I got a 4.0 this semester!
 
well done!
 
I've done it three times, and was less than a single point away from doing it a fourth time.
The class I didn't get it was really messed up.
 
2:36 AM
@Hosch250 WPF and WinForms have not much in common.
 
It was supposed to be OS concepts, but we were being quizzed on whether Python supported multi-threading without ever discussing/reading about Python...
@Mat'sMug Oh well.
 
layout is hard
avoid resizable dialogs if you want to keep your sanity
 
Lol, sure.
 
merging
11 incoming, 9 outgoing. syncing
10 conflicts, 1 unresolved
 
I hope the new email app is sending bug reports to MS. It crashes something awful.
I diagnosed one bug, anyway - it crashes when you delete the active email.
Just sent feedback.
Dishes time, see you.
I can finally sleep easy :)
 
2:49 AM
later!
 
[retailcoder/Rubberduck] retailcoder pushed commit a9d089fb to next: merged GrammarIsFun into Next
> Closing for now, d819d77 addresses this - I've tested it with a number of test cases, but I'm still not very confident about it (see github.com/retailcoder/Rubberduck/commit/…).
[retailcoder/Rubberduck] retailcoder pushed commit a1c4173b to next: minor fix, #461
> a1c4173 makes me more confident about it :smiley:
> d819d77 drastically changes how the refactoring works. I no longer get a repro with the above selection:

![extract method dialog showing above repro actually working](https://cloud.githubusercontent.com/assets/5751684/7625299/a1f7ac16-f9c3-11e4-9ec8-875c22af070c.png)

I therefore consider this one closed.
 
3:28 AM
0
Q: Extract Method: A refactored refactoring

Mat's MugThis post is somewhat of a follow-up to Rubberduck's "Extract Method" refactoring implementation. A tremendous amount of things have changed since version 1.2, when this that feature was first introduced - the more important thing being the advent of the Declarations API, which implies that the ...

 
Back again.
 
I'm going to call it a day soon
 
> Hosch250 wants to merge 11 commits into Hosch250:next from retailcoder:next
Just merge them already, alright?
Come on, GitHub!
 
3:44 AM
@Hosch250 merged?
 
No, it says there are conflicts.
Got it.
Downloaded.
 
And, we are down to 117 from 120!
 
292 closed
 
It appears the UserForm thing is behaving perfectly correctly.
No, it isn't.
Hmm, I can type a name in the other box.
return "    " + result;
 
3:49 AM
huh?
 
Looks like a tab would be in order.
Reading your question.
 
oh
nevermind the indentation - I have the source code for the Smart Indenter add-in, that's going to be embedded into Rubberduck by 2.0
 
IEnumerable<string>?
private static readonly IEnumerable<string> ValueTypes = new[]
{
    Tokens.Boolean,
    Tokens.Byte,
    Tokens.Currency,
    Tokens.Date,
    Tokens.Decimal,
    Tokens.Double,
    Tokens.Integer,
    Tokens.Long,
    Tokens.LongLong,
    Tokens.Single,
    Tokens.String
};
Isn't Tokens an enum?
 
Tokens is a resource file
 
Oh.
It looks like an enum would be in order, or no?
 
3:51 AM
look at the resouce file.
under Rubberduck.Parsing.Grammar
what should be the name of CommentMarker with its string value of "'"? ;)
or LineContinuation "_"
 
Oh, I see.
XOr Xor
Why XOr?
 
it's the VB casing
 
OK.
 
eXclusive Or
 
Yeah, I know.
 
3:58 AM
shit
code inspections are broken
they don't launch
 
Lol, Edge is a bit of a joke right now.
 
oh well, that'll be for tomorrow.
good night
 
Good night!
It doesn't have history, it is a pain to adjust the favorites...
 
4:13 AM
@Mat'sMug Here is the rename/preview in VS:
Better image:
(And yes, I hit Cancel in both these instances...)
Hi, @Phrancis.
Don't you wish you were learning C#?
Then you could work on RD.
Good night, all.
 
 
4 hours later…
8:40 AM
> Hi,
I use version 1.3.1 with Office 2013 (32-bit) on Windows 8.1 (64-bit).
In a module, if I use the following code:

`Open myFile For Input as 1`

the module disappears in the code explorer and is ignored by the inspector.
 
9:35 AM
0
Q: Delete Columns Using Dates

Meringue90I have a sheet where a macro duplicates the sheet and then inputs the days of the month and year across the top. The template sheet has 31 pre-formatted columns which get the dates filled into them. I am trying to delete the columns that come after the last day of the month because not all mont...

 
10:20 AM
> @retailcoder looks like this one is back since the grammar change.
 
0
Q: Delete extra columns based on dates

Meringue90I have a workbook that I have already programmed to duplicate, autopopulate the top row with dates based on month and year input. Each month has a different number of days. I have formatted 31 columns in the template. When the days of the month fill in at the top of the sheet, I want to be abl...

 
 
2 hours later…
12:07 PM
> Thank you for your feedback! I suspect the 1 in "As 1" is tripping the *fileNumber* parser rule. Try this instead:

Open myFile For Input As #1

I need to figure out a way to allow an integer literal there without a "#".

Note that a better practice would be to let VBA assign a free file number instead of hard-coding it, using the FreeFile function:

Dim fn As Integer
fn = FreeFile

Open myFile For Input As #fn
 
@StackExchange I helped this guy fix this issue 2 or 3 days ago, then sent him to CR to get his ugly macro recorder code cleaned up. I guess he broke it then came back to CR to get it fixed.
le sigh...
 
@FreeMan actually, I reviewed his working code. Then he had trouble implementing an improvement.
-2
A: From New Worksheet, AutoFill Dates, Delete Extra Columns, Save As Month and Year

Meringue90So, I have MOSTLY solved the problem of deleting the excess columns. I use a range and delete entire columns. The code looks something like this: Populate DailySales, DailySales.Range("B6"), DailySales.Range(DailySales_ .Cells(6,2),DailySales.Cells(6,2+Days)) Range(Cells(1, 3+Days), Cells(1, ...

 
Yeah, I knew one of you guys looked at it. Well, I guess we all have to learn..
 
So, if @Mat'sMug has a delete vote to spare.... that needs to go.
 
and now, back to my broken code.
 
 
2 hours later…
2:05 PM
2
Q: What is the best way to handle try catch in vb6?

CBRF23I asked a question on stackexchange and was given an answer by multiple people that checking for errors in-line was not a good practice. I have been using an on error resume next do something on error goto 0 block structure for years as kind of a ghetto "try-catch" structure in VBA. Here is a...

 
2:35 PM
@StackExchange Ugly. Hungarian. Bad error handling. Bad paradigms. Oh wow...
 
2:46 PM
I was just about to ping you and ask. that looks way too complicated
 
0
Q: Using a nonsense string to check if a call has completed, rather than timeout?

CBRF23My question is whether or not this is a good practice, and/or if there is a more efficient way to do it. I have to access this Solidworks interop object and wait for it to return some value. The return is a string. In early testing I found I ran into issues if I didn't wait for the return, so...

 
I encourage you to give it some time between questions. What you learn in one review will likely be applicable to other code. — RubberDuck 16 secs ago
 

« first day (342 days earlier)      last day (2838 days later) »