« first day (312 days earlier)      last day (2868 days later) » 

00:00
RELOAD!
[retailcoder/Rubberduck] 8 commits. 1 closed issue.
[skiwi2/Duga] 5 commits.
 
1 hour later…
01:14
> Added ForEachStmtContext to self-assigning identifiers (next to ForNextStmtContext)
02:03
hi @Rossco!
thanks for that upvote :)
02:30
No problem, it was a good response.
I'm not sure I'm careful enough when turning off screen updating.
wow.. I'm hitting the stupidest wall.
I have this Find all references docked window, but I want its caption to say what the search target is...
but Microsoft.Vbe.Interop.Window.Caption has no setter.
I haven't checked your code, but do you use the CreateToolWindow method to do that?
yeah, just found it myself.
realised I still had it open in VS
so you set the caption when you create the window but can't update it after that?
02:46
yup. I think that's because windows are then referred to by their caption/name.
Have you inspected "userControlObject"
what about it?
(and where's that?)
it is returned as one of the parameters from that COM method.
var toolWindow = _vbe.Windows.CreateToolWindow(_addin, _DockableWindowHost.RegisteredProgId, control.Caption, control.ClassId, ref userControlObject);
oh, right. well that's the user control, not the window
You're casting it to _DockableWindowHost
Does it have a caption setting?
02:49
nope
Otherwise there is probably some window api you can use to find the window and alter it's setting.
ugh!
yeah.. I think the easiest it just to change how I'm instantiating that window, and only create it once I know what caption I want for it ;)
I remember that method explicitly because it was really hard to get that parameter to work.
that's a good idea.
gtg
good luck.
later!
thank!
03:04
mwhahaha this is so fucking awesome!
03:42
@Mat'sMug Abusing Using LINQ again? ;)
this, my friend, is a dockable VBE window showing all references of a procedure called QuickExecuteNonQuery in a VBA project :)
Oh wow, that is pretty fucking cool!
And let me guess; you could easily refactor/rename all of the references in one fell swoop?
wo there
lol
actually.. yeah
just not from that window... hold on
the rename refactoring is from the refactor/rename context menu; find all references is, well...
telling you, v1.3 is starting to look very, very cool :)
03:52
Sounds handy, even if it's a couple extra steps
point is, you don't need to find all references to refactor/rename - it finds them for you
@Mat'sMug Did you get good feedback on Twitter on the SC integration being benched until after 1.3?
@Mat'sMug True
you just right-click whatever you want to rename and rename it. RD deals with renaming all usages
@sᴉɔuɐɹɥԀ not much
Benched... not the best word choice, but you get what I mean
03:55
Have you and ducky decided how you're going to go about it?
whenever SC releases, we're calling it 2.0
I see, that sounds reasonable, sounds like a pretty large feature to put together... lots of moving parts and such I'm guessing
uh-huh
meanwhile I have quite a bit of cleanup to do
hmm perhaps I should make the view a... treeview, showing the modules and procedures the references are found under?
Well, I'm going to play Destiny on recently acquired PS4, then hit the bed
allright, have fun!
04:00
@Mat'sMug Might be overkill? I dunno, your call
IIRC that's how MZ-Tools has it
See ya tomorrow morning
(and my code seems to be much faster!)
(but theirs is probably more accurate)...
> fixed reference selection issue
> implemented "FindAllReferences" presenter
> Commit github.com/retailcoder/Rubberduck/commit/… implements this feature in the code pane context menu
> Merge branch 'UI'
04:20
and TTGTB
 
8 hours later…
12:15
Hi!
Is there anything that will generate generic Getters/Letters for private variables in a class?
If not, that would be an awesome feature!
12:32
@FreeMan Letters?
MZTools has something and there's a real basic built in (i.e. terrible) function in the IDE.
Feel free to submit a feature request @FreeMan.
@skiwi one sec
Public Property Let MyProperty(newValue As string)
    variable = newValue
End Property
In VB6 there are two kinds of assignments. Settings references and Letting values.
That sounds unusual to me, but I'm no tused to VB6
@skiwi What RD said. VV
Public Property Set MyProperty(newValue As Object)
    Set variable = newValue
End Property
@RubberDuck Yeah, I've been messing with that. It's awkward. Almost as much work to type it by hand as it is to use the tool.
I'll put a feature request in.
12:36
@RubberDuck I can try to set up an address @rubberduck-vba.com, and send the whitelist requestd from there...
@Mat'sMug Okay. Honestly, I'm thinking of putting an FAQ on the wiki and calling it a day.
Or, organizing a mass movement against the anti-virus companies....
Ya know, one or the other.
> When parsing a Class Module, identify all Private properties that don't have Public Get/Let functions. Offer to generate them one-at-a-time, or bulk generate them all. For example: Private pMyString As String Private pMyLong As Long Would produce: Public Property Get MyString() As String MyString = pMyString End Property Public Property Let MyString (ByRef x As String) pMyString = x End Property Public Property Get MyLong() As Long MyLong = pMyLong End Property Public Property Let MyLong...
(ByRef x As Long) pMyLong = x End Property The ByRef could be changed to ByVar, or it could be user-configurable.
@ckuhn203 - I understand the reasoning behind ByVal, but wouldn't ByRef make for a faster call?
Yes, but at that point we're talking about micro-optimizations that really don't matter all that much in the big scheme.
And ByRef lets you do nasty things to your clients that should be prevented.
Fair enough. Been programming a long time, finally getting my head wrapped around classes and what they can do for me. There seem to be so many extra calls with the Getter/Setter for private variables, that every little bit of optimization would help.
Just seems very inefficient...
    Property Let MyProp(ByRef newValue)
        variable = newValue

        newValue = 42
    End Property
Pre-mature optimization.
awkward...
:)
13:06
Big boosts in runtime come from algorithm improvements.
@FreeMan LOL, right?
indeed...
Isn't 42 the answer to life, the universe and everything, though? Wouldn't that actually be doing your code a favor?
for some reason, I just remembered that 42 was Jackie Robinson's number. Random, mildly-interesting factoid...
I wrote a report about Jackie Robinson in like the 3rd grade.
13:35
@FreeMan they're private fields - the operation is a refactoring called encapsulate field - certainly feasible :)
@Mat'sMug So, that would be refactoring from corn field to baseball field?
otherwise, you lost me...
You right-click a field declaration, and select refactor/encapsulate field - it generates a getter/setter combination for it
13:54
@FreeMan a field is a class level variable. Particularly, one that gets exposed to the outside world.
@Mat'sMug Ah, you're talking about my suggestion/feature request. Got it.
sorry, jumping from conversation to coding and back, I wasn't tracking with ya'
OK, hitting a wall here.
Class A is a list of items. Class B is a collection of Class A.
Procedure One generates a collection of A, then sets ClassB.Collection = the generated collection
Later I call Procedure One again, generate some more Class A items in a collection & want to Add them to the existing Class B.
My current code is overwriting them with `Set PivotTableList.PivotTableItems = PTL'.
How do I add that in?
Do I override the .Add or create a setter that creates a new list if it's null, otherwise loops through the passed collection & adds them individually?
Can we see an example?
    Private Sub ProcessDataSheet(ByVal NewSheet As Excel.Worksheet, ByVal NewXLName As String, ByRef PivotTableList As PivotTableItems)

    Dim PI As PivotTableItem
    Dim PTL As Collection

      Set PI = New PivotTableItem
      PI.SheetName = NewSheet.Name
      PI.TableName = pt.Name
      PI.Address = "'" & NewSheet.Name & "'!" & Formula
      PTL.Add PI, Key:=PI.TableName

      Set PivotTableList.PivotTableItems = PTL

-------------------------------------------------------------
    Public Property Set PivotTableItems(ByRef lPivotTableItem As Collection)
when ProcessDataSheet is called a second time, pPivotTableItems is getting overwritten with the new list from PTL, not adding the new list in.
You need an Add method.
14:09
I've just changed it to:
I think.
Public Property Set PivotTableItems(ByVal lPivotTableItem As Collection)
Dim PI As PivotTableItem

  If ppviottableitems.Count = 0 Then
    Set pPivotTableItems = lPivotTableItem
  Else
    For Each PI In lPivotTableItem
      pPivotTableItems.Add PI, Key:=PI.TableName
    Next
  End If
End Property
would that work?
It would work, but it's not very nice.
I didn't think so...
You've confusing setting a property and merging two collections.
14:10
how do I make it nicer?
If I do this....
Set class1.PivotTableItems = someCollection
I wouldn't expect the original items to be there still.
In your code, that's exactly what would happen.
What you should do is add the second half of that property as a Merge(ByVal lPivotTableItem As Collection)
doing that, I need to know whether to set class1.PivotTableItems = someCollection or class1.Merge (someCollection)
so the distinction needs to be made by the calling code, not the class...
Yes.
But... YMMV.
Well.... no. Because you just always Merge instead of setting the collection.
And honestly, that collection is an internal detail that the outside world shouldn't be allowed to frak with anyway.
@RubberDuck That's a public field - a field is usually private ;)
Sorry for the delays here.. lol
Yeah yeah. Trying to KIS.
in The 2nd Monitor, 3 mins ago, by Dan Pantry
setCompany = (company: Company) => {
  // This is so stupid
  this.ShareSvc.Data.CompanyId = company;
  // Why can't we just use angular the wait it is meant to be used instead of abusing
  // it like this. I'm going to need a big tub of icecream to get over this.
}
14:23
OK, I've changed it to:
Public Property Set PivotTableItems(ByVal lPivotTableItem As Collection)
Dim PI As PivotTableItem
  For Each PI In lPivotTableItem
    pPivotTableItems.Add PI, Key:=PI.TableName
  Next
End Property
Which would, essentially be .Merge() (Right??)
I'm getting Run-time error '91': Object variable or With block variable not set on the .Add line
It goes and gets PI.TableName just fine, but doesn't like adding it to pPivotTableItems which is the collection...
In the Class_Initialize method, you'll need to set the collection to a New Collection so that it already exists.
ah...
OK, thanks! that took care of getting the data in there. Now I just have to figure out how to get it out... :/
I'll go find a random RD post on a question and give you a +1 :D
Is there any drawback/taboo about leaving that as the Set code instead of calling it Merge? Whichever name I give it, it's the only one that would be used.
You might want to take a look at the code in this answer.
38
A: How to use the Implements in Excel VBA

It's been a pleasureThis is an esoteric OOP concept and there's a little more you need to do and understand to use a custom collection of shapes. You may first want to go through this answer to get a general understanding of classes and interfaces in VBA. Follow the below instructions First open Notepad.exe and ...

@FreeMan Good question.... I would say that it breaks the semantics of what a property is.
Because, it doesn't actually Set anything. It's really not what it does, so it breaks the Principle of Least Surprise.
14:42
Don't make a property if what you need is a method ;)
71
A: Properties vs Methods

Ken BrowningFrom the Choosing Between Properties and Methods section of Design Guidelines for Developing Class Libraries: In general, methods represent actions and properties represent data. Properties are meant to be used like fields, meaning that properties should not be computationally complex or prod...

OK, so if I always call .Merge, that's confusing because I never set anything to begin with
But if I set the first time through then Merge after that, my code has to know the logic in my class.
and every instance of code needs to know that logic, so I'm pushing what should be hidden into the light, right?
if I update the Set to decide if it needs to be added or merged, that encapsulates it all within the class, which is the goal, correct?
not trying to be difficult, trying to learn something here...
Reading some of the above, I'm getting the feeling that VBA isn't the best place to learn OOP... :/
OOP has 4 pillars: Abstraction (VBA: check), Encapsulation (VBA: check), Inheritance (VBA: woopsie), and Polymorphism (VBA: ...somewhat)
so yeah, VBA isn't really an OOP language
VBA is a POOP language?
Kind of @skiwi. It's OOP, but not.
@FreeMan I don't see how always calling the class' Merge function is confusing. What happens when you Merge nothing with a List of something?
something I guess ;)
or.. nothing
14:56
@Mat'sMug Exactly!
@skiwi it's a NQOOP language.
not quite object-oriented programming
@Mat'sMug Not quite ;)
@RubberDuck That's what I'm trying to learn/clarify. I'm cool with that, just trying to make sure my understanding is correct. ish.
OOPish
Hey man... it's just like, my opinion.
YMMV
15:01
Monking!
Monking
Monking!
MMMMMonking!
Welcome to CR! You're probably better off including your actual code, not just "explanatory snippets" - on this site the code is front & center, and reviewers typically comment on any & alll aspects of the code. You can improve this post by using a title that somewhat describes what your code is doing, ....and @Rubberduck has beaten me to it again. — Mat's Mug 8 secs ago
@Mat'sMug auto-comments ftw
15:20
@RubberDuck I think there's one last glitch to work out with refactor/rename and then we're good to release 1.3
4
MemberCall needs to "know" if the parent member is a known identifier
I think ADODB.Connection gets picked up as a usage of Dim connection
#RevealedByFindAllReferencesFeature
@RubberDuck close vote retracted BTW, OP massively edited their post
@Mat'sMug might want to remove that.
removed
Thanks for the ping btw.
@Mat'sMug Better leave that one bug then to be honest, if you remove it, then two more will come back.
3
15:32
lol
16:13
Whew! Thanks guys! With your help on the classes, and my eventual realization that shape.SetSourceData is invalid, but Shape.Chart.SetSourceData is valid, I'm on the road!
Also, I've starred the questions that @RubberDuck and @Mat'sMug linked earlier. Very helpful
lunch?
@FreeMan You're welcome.
Incoming CR request
1
Q: Comparing cells of two Worksheets

NicoWith the following Code I try to compare the content of two Worksheets. The first column contains a key that is unique and the following columns contain data that I want to compare (My data sets contain around 7000 rows and up to 40 columns). My question is if there is a way to make the code ru...

@RubberDuck I'd help the lad, but my brain hurts too much from working on my own issues today... :/
16:32
@FreeMan It's okay. I've got it.
16:49
> Stephen -
Which email plan did you want?
you -
we're only 2 devs on the project, I was wondering, if I only take 1 email address, does the other dev need to have access to my godaddy account to read them, or it's separate?
Stephen -
There is a separate web login area not within the Godaddy account if you just want one email address
you -
so we can both set up the account on our respective cell phones and send/receive with that account? like, [email protected]?
Stephen -
Yes, if you both are sharing the email and password
@RubberDuck whew!
@Mat'sMug I don't even want to ask.
@Mat'sMug WTF. I got free of as many email addresses as I want through GoDaddy, wtf is that guy talking about
what's your plan? I got the basic-basic-basic stuff
and everything seems to be à la carte...
Yup, me too. Mine is just the domain name, no hosting (like the $10 a year or whatever)
Oh, wait. No. I got my emails through HostGator, not GoDaddy
Still, that seems like a lot of fuss to set up a damn email address
16:57
well $3.99/month for a info @ rubberduck-vba.com sounds about right... no?
A bit steep IMO, but if you really want it (as opposed to, say rubberduck-vba @ Gmail for example) I guess it's not too bad
well @gmail.com gets us a refusal from Symantec's whitelist
F symatec.
FAV's
@Mat'sMug That's a valid concern. Guess 4 bucks per month is not too bad; about the price of a Starbucks lol.
17:23
Can I do a mass-insert in Excel?
@skiwi what do you mean exactly?
Could be a couple of ways to do what you're asking.
I need to insert 35 rows at same row
Doing it by hand sucks
select 35 rows, and then right-click and "insert"
That ^
Pff, that's cheating!
But thanks :)
Doing inventory management in Excel as a programmer is broken on so many levels
2
17:29
TTFN
@skiwi Here. This should make you happier.
Public Sub test()

    Dim sel As Range
    Set sel = Application.Selection

    Dim i As Long
    For i = 0 To 34
        sel.Range("A1").Rows.Insert xlShiftDown
    Next
End Sub
in The 2nd Monitor, 55 secs ago, by vikrant
Hi there, first time in this chat room, want to know thoughts on my questions
Also, for some reason when inserting rows, the summations at the bottom of my shoot don't update their range
@skiwi Are they using an absolute reference?
i.e. A$10 instead of A10?
17:44
@RubberDuck Nope
That's by design. You need to insert rows at a row that's inside the ranges your formulas use - excluding the last row. Absolute refs won't change that
@Mat'sMug That's exactly what I did
Then the formulas should extend.
If you insert at the last row they won't
Oh...
Who decided that?
17:47
Some genius at MS
It broke countless reports throughout the years across the world...
Hi @jhadley!
I can surely imagine that
 
2 hours later…
19:41
Great
Our biggest two cable providers have completed their merge very recently and we got totally shafted here, I'm fearing we'll head towards American internet quality
The speed dropped from 12.5 MB/s to 3.5 MB/s on average, that's on a 120 Mbit line
Now the cable providers never had effective competition, but there was a US-based company and a Dutch company, and the US-based one bought out our Dutch one, but decided to keep that name for its reputation
20:20
@skiwi in JS would (isNaN(foo) === true) catch a null value?
@sᴉɔuɐɹɥԀ I would be able to answer that in most languages... but you're asking for JS
Hahah OK I'll just fiddle it :)
So JS has undefined and null, which are both illegal in a sense
And... let me guess, they are not the same? ;)
isNaN("") seems to return false, because by how JS works it actually makes a best effort to convert "" to a number, so it probably got converted to 0
And... isNaN(null) returns false, while isNaN(undefined) returns true
20:23
WTF
Oh man... are we talking about how JS converts (or doesn't) things to numbers?
Nobody wants that headache.
Yeah, don't bother with JS
Except it's the language you need for the web
So "" and null are numbers... but undefined is not...
Or rather, can be evaluated as numbers
Not quite
@sᴉɔuɐɹɥԀ Yeah, more like that
I'm not too familiar with it, but isNaN expects a Number, so JS tries to fit everything to be a number in order to help programmers
"" can be seen as 0, null can be seen as 0, etc.
But "" is a string... :\
20:28
Damn, HS just got release on iPhone and Android phone!
if (isNaN(foo) === true || foo === "" || foo === null) {
	window.alert(foo + " is not a number");
	return;
} else {
	// ...
}
^^ PITA or what?
Just JS being JS
With the === you are forcing it to not try to help you by implicit conversion, though not sure if that's available on methods as well
Hmm, okay that might help.
(sorry VBA guys I meant to post in the TCG room lol)
@RubberDuck I'm surprised it even costs you anything to add an e-mail address to a domain you already own
And you also own the hosting of it?
idk. You'd have to ask Mug.
He's the one that bought the domain and hosting.
@sᴉɔuɐɹɥԀ No worries. Nothing else was going on.
20:36
It seems like the mug is refilling himself ;)
21:06
@RubberDuck Do you think this would fare OK on CR? It got pinged by Duga but I don't think it would do that great here...?
 
3 hours later…
23:39
@skiwi I bought a domain (2 years recurring) and a website builder account (1 year recurring) - email sold separately, batteries not included ;)
$42.46 (CAD)
I get free email forwarding for 100 addresses with the domain

« first day (312 days earlier)      last day (2868 days later) »