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

3:13 PM
completed
@StackExchange good. keep 'em coming. I need moar VBA votes!
 
3:35 PM
> Thank you for your reply.

Indeed, using the "#" the module does not disappear.

Thank you again for the quick response and congratulations for your work.
 
huh, visitors can close issues?
 
He created it, he can close it.
 
it's really a issue though
 
> Glad it worked out for you @s3lli9! I'm going to go ahead and re-open the issue until we can fix the bug though.
 
3:38 PM
@Mat'sMug we have a grammar tag?
 
damn right
:)
 
So, just noticed that Microsoft Access Class Object (forms in particular) don't appear in the Code Explorer. Is that by design?
 
rather by accident
 
3:40 PM
what's their ComponentType?
 
@Mat'sMug Should be a document, but let me check quick.
They are Mug. vbext_ct_Document
 
then they should be treated as classes
I'm out of ammo, but I'll upvote your answer at 00:00:01 UTC =)
 
3:59 PM
^shot
@Mat'sMug what that at me:
22 mins ago, by FreeMan
So, just noticed that Microsoft Access Class Object (forms in particular) don't appear in the Code Explorer. Is that by design?
or @RubberDuck
23 mins ago, by RubberDuck
@Mat'sMug we have a grammar tag?
 
Ya know. I didn't check to see if it showed up for me. I just looked up its type. Will check after lunch.
 
4:24 PM
@FreeMan Shows up for me in the latest release.
Must be a parse error somewhere in your project.
 
@RubberDuck that's the Project Explorer...
 
That's what I was thinking... this is what I'm getting:
 
LOL. Oops.
 
Just means you did a good job Mug.
 
4:32 PM
lol
 
@FreeMan your code-behind has a parse error. are you on 1.3.0.1?
 
VTC'd on SO
I do feel inclined to downvote this, but will refrain from doing so. The problem is you don't have a concrete problem here. You have shown us VBA code and said "I want to do this in .Net instead", but not presented us with a particular problem you've run across in the process of porting your code. As it stands, this question is far too broad. Go give it a shot first. Come back when you run into a particular issue that you don't know how to solve. — RubberDuck 5 mins ago
 
@Mat'sMug sure am.
 
I wonder if the release build still defines the #DEBUG constant...
 
4:35 PM
Shouldn't...
 
if it does, you have a log file with a stack trace for the parse exception in your %APPDATA% folder
 
Nobody would ever let that happen!
 
cough
I am responsible for the 1.3.0.1 tag.....
 
I have rubberduck.config. nothing more.
 
tough luck then
you don't have numbered lines?
 
4:36 PM
no
 
are you opening a file with a hard-coded file number without a "#"?
 
no
still no
:)
 
something is breaking the parser
can you share some of the code-behind?
 
I'm really bad at intentionally testing things, but I'm really good at stumbling across weird bugs!
4
 
We need to make that log opt-in in the settings.
2
 
4:38 PM
what sorta code-behind you want?
 
the declarations section?
actually... there should at least be a Declaration for the form document itself... this is weird.
 
Option Explicit
Option Compare Database
That's it from the form module
 
that shouldn't bomb
@FreeMan there's nothing else?
 
nope.
I was just doing some Googling trying to figure out what else can even go there...
I found
 
lol
 
4:53 PM
Option Infer
Option Strict
 
wouldn't that be VB.NET though?
 
but those seem to be VB only, as the VBAIDE gets all red in the font about them...
 
never heard of Option Strict in VBA
ok
phew
 
:)
are there any other Option options? in VBA land?
 
moduleOption :
	OPTION_BASE WS INTEGERLITERAL 			# optionBaseStmt
	| OPTION_COMPARE WS (BINARY | TEXT | DATABASE) 	# optionCompareStmt
	| OPTION_EXPLICIT 						# optionExplicitStmt
	| OPTION_PRIVATE_MODULE 				# optionPrivateModuleStmt
;
 
4:55 PM
That ^
 
hunh... where'd you find that list? My google-fu must be weak today.
 
try adding Public Sub DoSomething() and reparse
 
Hmmm... shouldn't option base be OPTION_BASE WS ( 1 | 0 )
 
1 | 0 would be an implicitly-defined lexer token... bad.
besides the grammar assumes the code compiles, right?
 
Oh wow!
No. I was wrong. It's defined just like you have it. msdn.microsoft.com/en-us/library/ee199724.aspx
 
@Mat'sMug made no difference
 
yesterday, by Mat's Mug
I don't know what to tell you
 
@RubberDuck thx
 
5:04 PM
Your answer solved the question OP asked. His acceptance of the other answer indicates that wasn't the question he meant to ask... — FreeMan 11 secs ago
 
Well, I got the form displaying, but doing nothing.
 
it's a start!
now write a presenter :)
(and if you can, try to pull the actual refactoring logic outside the presenter code)
 
I'm working on it, but the window isn't even displaying right yet.
Did you see the rename preview screenshots I sent?
 
where?
 
5:20 PM
13 hours ago, by Hosch250
user image
There are a couple.
 
@Hosch250 I clicked the Cancel button. It didn't work...
 
oh right. that'll wait.
 
@FreeMan Fortunately, the Apply button doesn't work either.
 
Need me to submit a bug?
 
No, just a screenshot (...).
 
5:22 PM
gotcha covered!
 
Dear Microsoft:
The buttons don't work in screenshots. What are you going to do about it?
Sincerely,
Irritated User
3
On his blog:
 
Sadly, I actually did click the Cancel button trying to close out the browser tab...
le sigh...
 
Micro$**** won't fix the problem with screenshots not working like real programs. Go Apple (or Linux)!
 
@Hosch250 I'll show you ReSharper's tonight
 
OK.
 
5:34 PM
13:30 and I'm just now getting ready to write some code. What went wrong today?
 
^ scrolls back up the chatbox for 4 hours...
 
5:49 PM
 
Now, I just need to change the icon.
 
Huh, doing this busted it: this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
I just copy/pasted the icon from Rename.resx to my resx.
> Error 21 The name 'resources' does not exist in the current context C:\Users\hosch\Documents\Visual Studio 2013\Projects\Rubberduck\RetailCoder.VBE\UI\Refactorings\ReorderParameters\Reord‌​erParametersDialog.Designer.cs 148
Oh, got it.
> System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RenameDialog));
user image
2
I'm off to lunch.
 
6:17 PM
Could be interesting if I could make sense of it.
1
Q: VBA Array Sort with Fieldname as Parameter

BiggerDonHere's the deal...In trying to get past my fear of Class Modules in Excel VBA, I decided to create a class that is an array, then add functions (methods) for adding elements, sorting an instance, etc. Those are things I keep re-writing in normal modules as functions/subs but hope use of classes...

 
Apparently someone likes the UI given the star.
 
I like the ducky!
 
I didn't do that.
That is on all the windows.
Now, the hard part is done all I have to do is figure out how to reorder parameters.
 
@Hosch250 remember the ArgListContext? calling the .arg() method will give you a ReadOnlyList<ArgContext> where each item is a parameter, presumably in the order they were parsed, so left-to-right.
 
Yeah, I was thinking of that.
I'll ask if I need help.
 
6:31 PM
I think you'll have to use a TokenStreamRewriter to reorder the parameters in the signature, a bit like the Rename refactoring does.
 
OK.
 
your refactoring should have a Target which should be a Declaration with a DeclarationType of either Procedure, Function, PropertyGet, PropertyLet, PropertySet, Event, LibraryProcedure or LibraryFunction
 
OK.
 
being a Declaration, that Target will have all its usages under References
 
I have the target.
 
6:33 PM
@Hosch250 it wasn't in your previous screen shot (still with non-functional cancel button)
 
@FreeMan Because I wasn't finished with the UI yet.
 
0
Q: Next revision letter - looking for feedback on cleaning up, simplifying

CBRF23This is a fun one! I wrote some code to automatically get the next revision letter for a file by looking at the existing letter. It works, but I think there is room for improvement as far as simplifying it or making more efficient. Our revision scheme follows ASME Y14.35, which specifies the f...

 
@StackExchange Nope. Done.
 
cool. the hard part will be to get the references' ArgsCallContext, and reorder each individual ArgCallContext accordingly there, again using a TokenStreamRewriter
assume Target.References has all references; if it doesn't, the bug is in the identifier resolution code.
 
@RubberDuck you mean you're not going to do all this guy's (home)work for him? Here I was thinkin' you were a nice guy...
 
6:41 PM
I'm really not. Honest.
You wouldn't like me in RL.
 
lol
well, when hiding behind a keyboard and ducky, you seem nice enough...
 
Magic of the internet. =;)-
 
indeed!
 
Now, the thing that's really going to bug you later.
> Was he being serious, or wasn't he?
 
Come on, you can't learn by having someone else do if for you!
How do you think I got my 4.0?
 
6:44 PM
> Does he care, or doesn't he?
 
(And every other 4.0 student out there.)
So, the reorder window only shows when appropriate.
Now, I need to populate the list view.
 
@Hosch250 you'll want to add a menu item to the "Refactor" menu and codepane context menu
 
@Mat'sMug I did that first thing, so I could test the UI.
To the Refactor menu, anyway.
Not sure what you mean by the codepane context menu.
Can we set up keyboard shortcuts for refactoring?
 
so one can right-click a method signature and select "reorder parameters" from the context menu
@Hosch250 I wish. Eventually.
 
Sure thing.
That annoys me as bad as Excel crashing every time I close it and don't save my work.
 
6:48 PM
that'll learn ya to always save your work!
 
s/learn/teach ;-)
 
One other thing - I wish I didn't have to close Excel to load changes - when I'm testing, sometimes I'll rebuild several times a minute.
 
Some changes can be applied at your own risk during a debug session
 
Yeah, change the value directly, not the code.
 
The code too. at your own risk - method cannot contain lambdas (anonymous methods)
 
6:58 PM
Why does AcquireTarget() in RenamePresenter look like this?
            if (_view.Target == null)
            {
                return;

                // rename the containing procedure:
                _view.Target = _declarations.Items.SingleOrDefault(
                    item => !item.IsBuiltIn
                            && ProcedureDeclarationTypes.Contains(item.DeclarationType)
                            && item.Context.GetSelection().Contains(selection.Selection));
            }

            if (_view.Target == null)
            {
                return;
 
Because I can't decide if I want to infer the target or not :)
 
Oh.
 
In the case of reorder parameters you might want to acquire the containing method regardless of where the selection is
 
Maybe, will do that later.
Or, maybe will do right now.
 
1.22 has 241 downloads
1.3.0.1 has 30
 
7:06 PM
Party at your place when it reaches 1000?
 
I hope it never reaches that. Party when 2.0 reaches 1K in less than a month!
 
so long as it's not at @RubberDuck 's place, I'm in. I hear he's not a nice guy.
3
 
lol
 
I'm feeling light-headed and tired.
Anyway, the reorderparameters is coming along as expected - slow and steady.
 
too much RD awesomeness for one day?
 
7:18 PM
Nah, too much computer screen in general.
 
@Hosch250 that's beyond awesome, I wasn't expecting to ship that feature anytime soon!
 
And too much going to bed past midnight :(
@Mat'sMug Reminds me of Rhino.
 
you're committing to your own dev branch?
 
Yes.
> Rhino is Awesome! Rhino is .. is BEYOND Awesome!
 
'cause I was going to say, you could work that off the Refactorings branch, too
I'm not going to use it for a little while
 
7:19 PM
Nah, I'll just commit to next when I'm ready.
Manipulating Git branches is a pain.
 
not really. must be that I got used to it
but now that I think of it, Refactorings is stale and there are conflicts to resolve before it can be used.
 
It is the conflicts that bug me.
 
PPT irritation: ActivePresentation.Path yields a drive letter
 
oh wow
 
ActivePresentation.Slides().shapes().linkformat.sourcefullname yields a UNC
Dear Microsoft,
Y'all are idiots!
Love,
Disgruntled Programmer
 
7:27 PM
+170 on CR today
 
I hate this Layout view crap. It locks everything into a table and I need it to be more flexible than this.
 
So you say this will give me a list parameters?
var argList = (VBAParser.ArgListContext)_view.Target.Context.Parent;
 
that's the ArgListContext - you need to call the argList.arg() rule to get a ReadOnlyList<ArgContext>
have the VBA.g4 handy for reference ;)
ArgListContext is the type generated for the argList grammar rule, so Ctrl+F "argList :" gets you the rule definition
 
7:54 PM
Sweet!
Found this:
Private Function UNCpath(ByVal DrivePath As String) As String

Dim nwork As Object
Dim NDrives As Object
Dim i As Long

  Set nwork = CreateObject("WScript.Network")
  Set NDrives = nwork.EnumNetworkDrives

  For i = 0 To NDrives.Count - 1 Step 2
    If NDrives.Item(i) <> vbNull And InStr(1, DrivePath, NDrives.Item(i), 1) > 0 Then
      UNCpath = Replace(DrivePath, NDrives.Item(i), NDrives.Item(i + 1))
      Exit For
    End If
  Next

End Function
to convert a drive:path to UNC!
 
> The variable names lngX, strX, strY, and strZ are 75% Hungarian and 25% useless.
0
A: Next revision letter

200_successThe variable names lngX, strX, strY, and strZ are 75% Hungarian and 25% useless. I don't have a good idea of what their purpose is. You don't have to write a comment telling me that you are declaring variables; the Dim keyword is obvious enough. You've used recursion to solve this problem, whic...

 
LOL!!!
 
in The 2nd Monitor, 57 secs ago, by RubberDuck
> The variable names lngX, strX, strY, and strZ are 75% Hungarian and 25% useless.
 
lol
 
19 hours ago, by Mat's Mug
@RubberDuck great minds think alike I see ;)
3
 
7:57 PM
2 votes away from a bronze C++ badge.
2 votes and 2 answers away from a bronze C# badge.
And somewhere between 2 days and 2 weeks away from reordering parameters in RD.
2
 
8:18 PM
1 vote away from 42/50 on [badge:epic] :)
woot-woot!
 
Got it (wasn't me).
Hmm, how do I get the VBAParser.ArgListContext from type Procedure?
 
var argList = (VBAParser.ArgListContext)_view.Target.Context.Parent;
you have this already right?
 
Doesn't work.
It works for type Parameter, but not type Procedure.
 
inspect the type of Context.Parent
 
OK.
 
8:31 PM
oh
Context should be an AmbiguousIdentifierContext for the procedure's name.
Context.Parent could be several things
you'll have to go dynamic here
 
OK.
Like:
dynamic argList = (VBAParser.AmbiguousIdentifierContext)_view.Target.Context.Parent;
 
var identifier = _view.Target.Context;
var proc = (dynamic)identifier.Parent;
var argList = (VBAParser.ArgListContext)proc.argList(); // off the top of my head - refer to the grammar to confirm the correct member to call
 
Thank you.
 
var args = argList.arg();
foreach(var arg in args) { ... }
^^ that might not be what you want to do though ;)
 
The Parent is a VBAParser.ModuleBodyElementContext, and it threw again.
Cannot convert the above to a VBAParser.ArgListContext.
 
8:39 PM
oh that means the Context is the proc
 
OK.
 
so you can just cast Context to dynamic and call argList() on it
7 mins ago, by Mat's Mug
Context should be an AmbiguousIdentifierContext for the procedure's name.
^^ it's not - Context is the whole procedure context
 
Good, no throws now.
Thanks.
 
awesome!
 
TTFN
 
8:52 PM
@FreeMan What does that one mean?
Time To ? Now?
 
9:03 PM
TaTaForNow
 
OK.
I have the grid working halfway.
It displays the columns, but not the names.
I'm looking at the Extract Method refactor now.
 
that one has changed quite drastically since yesterday... I haven't merged to next yet
 
Oh, OK.
 
the name for an arg would be arg.ambiguousIdentifier().GetText()
 
OK.
I initialized my List with random strings, but it didn't display anything.
It has the right number of rows, though.
 
9:39 PM
how are you populating the list? better create an object and use bindings, sending strings to a ListView will probably not give the expected result..
 
I am binding to a List<string>
I am now loading it with the name of the parameters.
 
better create a type for it
 
It still has the right number of rows, but does not display anything and throws an error when one is selected.
 
TTYL, TTQW
 
OK, sounds like a good idea.
See you.
It works :)))))
You know, that smiley grinning so big it had grins falling off made me grin bigger than getting it working did.
It is still crashing when I select a value, for some reason.
Something about index -1 not having a value.
And when I run it in debug mode, it just closes without the error.
 
9:56 PM
Looks like an off-by-one error
 
@Mat'sMug It isn't.
It says "index -1 does not have a value" for any and all items selected.
Something in my system crashed:
Rebooted, and everything is alright.
 
10:16 PM
Our whole production database server died suddenly, it appears. Nothing is working now, all having ODBC connection failures. Good thing it's TTQW. And good thing I'm not a DBA right this moment ;)
2
 
System.IndexOutOfRangeException: Index -1 does not have a value.
   at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
   at System.Windows.Forms.DataGridView.DataGridViewDataConnection.OnRowEnter(DataGridViewCellEventArgs e)
   at System.Windows.Forms.DataGridView.OnRowEnter(DataGridViewCell& dataGridViewCell, Int32 columnIndex, Int32 rowIndex, Boolean canCreateNewRow, Boolean validationFailureOccurred)
   at System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMou
 
hey, @Mat'sMug and @RubberDuck, you seem to have managed to add a Twitter feed to this room, how?
 
Room feeds?
 
yes, but what is the URL?
from what I have found, Twitter doesn't support RSS feeds out of the box
 
10:26 PM
so now the question is just how they created that script
 
Can't help there.
 
then let's hope a mug or a duck can help :)
 
OK, I found the problem.
When I bind my List to the DataGridView, it is empty.
So, somehow the content is being displayed, but not really loaded?
 
10:40 PM
@SimonAndréForsberg I don't quite remember. Someone created a tool to turn twitter feeds into RSS feeds with a google apps script.
Oh. Hey! Here it is @SimonAndréForsberg.
Feb 27 at 20:04, by Phrancis
http://www.labnol.org/internet/twitter-rss-feed/28149/
 
Fixed it :)
I just can't initialize the datagrid until Parameters is loaded.
 
Publish your branch, I'll take a peek later ;)
(and it will boost our commit count for @Duga's daily update!)
 
@Mat'sMug I knew it!
 
I published it to my fork.
I don't know how to publish it to yours.
 

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