« first day (1159 days earlier)      last day (2021 days later) » 
00:00 - 18:0018:00 - 00:00

00:00
then these's command bindings, which bind a xaml element to an ICommand (the very same we inject into the VM's!)
@shadowofsilicon no. to the view model.
unless it's strictly a presentation concern. the code-behind belongs to the view, it's reserved for purely presentation stuff (e.g. if you want a button to glow on hover)
Thanks again RD team for helping me understand more. Home Time.
but 90% of the time whatever you can do in code-behind you can implement declaratively with xaml
@IvenBach I want the IQueryable to be executed on the database, or whatever LINQ provider it is targeting, and do whatever follows in-memory, i.e. via LINQ-to-objects.
00:03
basically you can't approach WPF with a WinForms mindset - unlearn everything you know about UI design =)
@Mat'sMug Well, it's both... If it's a project or not, it's got to show different text when displayed to the user, but also use a different command when the menuitem is chosen
But does it have to be a separate command?
Does the command accept and use a parameter?
00:04
@Mat'sMug Good point, no, it does not.
Or maybe it's easier to implement as a separate parameterless command...as with many things, there's not One Single Right Way
Wait... Yes, it has to be a separate command; Export uses a Save As dialog while Export All uses a folder browser.
> Hmm, makes me wonder if we're resolving default parameter values. I presume enums to the same?
Could the menu item call a method that determines which command to use?
00:09
The menu item will have a command binding
The framework will use that to determine whether the button is enabled or not
Kids bed time, bbl
'Gnight!
Thx for the help!
> I have a variable constant:

```vb
Const BUILD_ON_WEEKDAYS_ONLY = True
```

Which raises an "Implicity Variant Variable" inspection.

**Fix all occurrences in procedure** raises this error:

![fixinproc](https://user-images.githubusercontent.com/16574009/29050854-f60af546-7c21-11e7-8b00-581e7329e804.png)

All the other fixes do nothing.
@Duga a variable constant huh?
@Duga failed assert. something is definitely wrong.
@shadowofsilicon not me, the kids! lol
@Mat'sMug lol, totally missed that lol
@Mat'sMug IKR - that's what the inspections says!
00:21
huh, missing an "or" somewhere?
Ah, the name and meta description are too narrow - that would be a separate (trivial) issue
@Mat'sMug The logic would be in a separate class.
@shadowofsilicon Can't, as far as I know.
@Mat'sMug I'm pretty sure yes.
Simplest method would be to use a loop and call the existing command.
TTYL.
@Hosch250 What? 'Cmon, its gotta be possible. I see it happen all the time (don't know about inside WPF, though...)
00:42
@Mat'sMug What is DelegateCommand?
@shadowofsilicon it's one possible implementation of the ICommand interface. A rather cool one, that makes it easy to delegate the CanExecute and Execute methods to private members of the VM, or even inline a trivial implementation
@Duga pretty sure that's a dupe
So... In the VM, I can't call the CanExecute or the Execute methods directly, but I can call each via a DelegateCommand?
The framework calls the methods for you
look at some of the existing implementations
The injected commands inherit CommandBase, which implement Can/Execute in a separate class; the trivial ones are DelegateCommand instances, with take a (wait for it..) delegate (who knew!) for the Can/Execute implementations
So you can have a new DelegateCommand(o => DoSomething(o)) and implement the meat in DoSomething
@Duga wah, <200!
@shadowofsilicon of course it is. very little is impossible with WPF. You want a transparent, ducky-shaped window? You can! (in an actual WPF app at least)
Now try that with WinForms =)
00:57
> This should perhaps honor any type hints:

`Const LONG_NUMBER = &H1` is implicitly an Integer
`Const LONG_NUMBER = &H1&` is a type-hinted long
> linking #3167
@Duga huh, the inspection shouldn't pop a result if there's a type hint
@Mat'sMug well it does, but wouldn't it be better to have an explicit type?
@Mat'sMug Actually, I tried to do that there (admittedly, I didn't try very hard). It isn't particularly simple to hide a context menu item the way we are doing it for some reason or another.
I think it is related to the way it isn't in the actual layout tree, or whatever it is called.
01:21
@ThunderFrame technically the hint is explicit.. and there's already an inspection that changes type hints to named types
Public Const FOO As Currency = 1.12345  ' = 1.235
Public Const BAR As Currency = 1.12345@ ' = 1.234
@Hosch250 I'd take the file/folder browser dependency out of the command (and into the VM), give it a string/path parameter, inject that into the VM, and make a delegate command that takes the selected node as a parameter and thus knows if we're looking at a project or a module (exporting a [bunch of] procedure node[s] into a .cls or .bas file would be awesome too)
@ThunderFrame how about "implicit conversion from literal before assignment"?
@Mat'sMug Would a menu item in the Rubberduck menu be able to use it from the VM?
Hmm I like that one
@shadowofsilicon hmm, nope
@Mat'sMug Well, actually, the pretty-printer converts 1.12345@ to 1.1234@ - It should almost be mandatory to use a type hint in an literal assignment - YUK!
01:30
I guess there wouldn't have to be a menu item for it in the Rubberduck menu, but IMHO there really should be, at least for Export All... I don't believe that functionality should be exclusive to the Code Explorer
@ThunderFrame or an explicit type conversion?
@Mat'sMug Can't do that in a Const
@shadowofsilicon agreed. you need a separate command class for that, not a delegate command
how's the single-file export command using its parameter?
hmm it needs a presenter
presenter?
Damnit, CodeExplorerWindow.cs! Y U BROKEN? What did I do to you?
ExportCommand is inside the Code Explorer class... it recieves a CodeExplorerComponentViewModel and tells the VBE to export that component (actually, we overload the VBE's method)
The ExportAll command that I wrote currently takes a IVBProject and does the same thing with all of the components in the IVBProject...
However, that will prob be changed to CodeExplorerProjectViewModel
Or, if activated via the Rubberduck menu, it receives nothing... then it uses the active project
 
1 hour later…
03:49
> Given the following code:

```vb
Sub foo()

100 'line-number
200: 'line-number with instruction spearator
300 Beep 'Line-number and instruction
400: Beep 'Line-number with instruction separator and instruction

bar: 'line-label
buzz: Beep 'Line-label and instruction
50 fizz: 'line-number and line-label
10 foo: Beep 'Line number and line-label (that matches procedure name) and instruction
20 boo: Beep 'Line number and line-label and instru
@shadowofsilicon
> Welcome to Git for Rubberduck! Why not take a look at our [training] or [documentation]?
> It doesn't matter whether the line-number is 1 digit or 7 digits, all of the numbered lines below trigger the inspection:

```vb
Sub foo()

1 'line-number
20: 'line-number with instruction separator
300 Beep 'Line-number and instruction
4000: Beep 'Line-number with instruction separator and instruction

bar: 'line-label
buzz: Beep 'Line-label and instruction
50000 fizz: 'line-number and line-label
600000 foo:
04:11
ok, I love using static Rubberduck.Parsing.Grammar.VBAParser;
oh wait, that's C# 6
04:25
> They all end with... a numeric value (:facepalm:), that's why. Fix is simple: the inspection needs to ignore any declaration whose Context is a LineNumberLabelContext.
04:45
@Mat'sMug - so I know you like a good error handler... have you seen this one: stackoverflow.com/a/31887533 ?
(btw... I'm saying this is good, just have never seen it in VBA before...)
Private e, nFound, nMoved As Long
Private fso, Folder, SubFolder As Object
Private Exists, FielFound, Handled, NoError As Boolean
won't read past
;-)
On Error Resume Next
For Each SubFolder In Folder.SubFolders:                            Call ErrorHandler
    Source = SubFolder.Path & "\_Hotels.xlsx":                      Call ErrorHandler
    FileFound = (Dir(Source) <> ""):                                Call ErrorHandler
    If FileFound And NoError Then
        Exists = True
        nFound = nFound + 1
        fso.MoveFile Source, "C:\Hotels.xlsx":                      Call ErrorHandler
        If NoError Then
            nMoved = nMoved + 1
that is satanic
and plain stupid
Yeah, I thought you might like that...
I mean, I noticed the Call ErrorHandler calls at the last minute.
and then realized how bad it really was
geez
and they're all aligned
04:51
sorry, I think I may have distracted you - although, sometimes it is interesting to see what people do think is 'worthy'; this was a proposed solution chuckels
for code like that, Rubberduck needs a rage crash quit feature
It looks like you're mocking me. Let me crash the VBE for you
5
Parser Fix for LineNumberLovers (#3217)

* removed unused ParserState ctor parameter

* updated assembly version

* fixes #3216

* works with SLL prediction mode

* added more tests. parses line numbers on End Sub|Function|Property.
Mar 9 at 15:34, by FreeMan
@Comintern I'ma gonna go with my standard, "5,000 volts @ 10,000 amps solves the problem once and for all" should be the RD response to that code
2
Define better error handlingThunderFrame 11 secs ago
TTGTB
Inspection + resolver fixes (#3228)

Resolves optional parameter default value expression, fixes ImplicitVariant quick-fix for constants, and UnusedLabel now properly ignores line numbers and yields expected results.

* fixes #3227
* fixes #3226
* fixes #3224
* fixes #3223
[rubberduck-vba/Rubberduck] build for commit 727fb6ff on next: AppVeyor build succeeded
 
5 hours later…
10:55
@NicuTofan: Hi! You need help with autocad?
11:18
@IvenBach Add it to the wiki list!
11:32
@Mat'sMug heh... I was going to go dig that one up. Thanks for saving me the effort!
@IvenBach Already planning to have them review WiseOwl tutorials :). Not all of them of course (there are some videos that I have never needed the content of) but they are a good beginner series on VBA.
11:49
Hey chaps.... random question
has the topic of VBA performance ever come up from RD code inspections?
For example, For Each is faster than For Loop for collections (I think) but not Arrays... could be the basis of an inspection...
Kaz
Kaz
@SlowLearner Most VBA performance improvements would come from things that you can't easily & consistently test for/detect.
^ With that you have to keep in mind that For Each only works with Enumerable types, so you cant use For Each on a Dictionary for example. You may have a hard time teaching a user that distinction through an inspection (and it generally is a micro-improvement if I am not mistaken).
Hi Kaz, yeah I get that... but so far nothing in the RD project seems particularly easy to me ;-)
@BrandonBarney the performance improvement can be quite significant... let me grab some random stats. Back soon
@SlowLearner Certainly go for it. I would be interested to see the effects, especially since I use a lot of dictionaries that arent enumerable and it may be worth converting to COllections or using Thunderframe's enumerable class.
I've been messing with Today's release of RD... first chance to play on a smaller project...
Kaz
Kaz
11:57
Though an in-built benchmarking/analysis tool would be really cool.
2
I definitely wouldnt have imagined a 27x performance difference for collections. I'll have to consider that.
@Kaz +1. I would love something like that, especially if it could benchmark the individual subroutines automatically.
Right now I have to have subclasses send everything up to the main class.
What exactly would a benchmarking tool do... I'm assuming something more than timing code??
Kaz
Kaz
@BrandonBarney I would love some kind of abstraction-level-benchmarking. Where it starts at the top and then lets you expand each statement/subroutine/loop etc. to see where all the time got spent.
@SlowLearner No, pretty much just timing code, but timing individual functions, subroutines, loops, etc.
12:00
@Kaz I would be in heaven. Even moreso if there was a way to have it run X times, and for it to export the results to a spreadsheet or something.
@SlowLearner You may want to wander through the star list for this. I believe @Mat'sMug and/or @ThunderFrame (go figure) were doing some benchmarking on someone's question about this. They found some generalish cutoff points on where things were faster one way or the other (including copying cells to an array vs working in the worksheet, if I recall), but the real answer is #ItDepends
Kaz
Kaz
The real answer is "Build it. Make sure it works. If it's taking too long, time bits of your code to find out where 90% of the time's being spent, and then re-architect that bit a little"
Also: Arrays, Dictionaries, and avoid directly manipulating worksheets/books
Dictionaries are amazing
I spent a few months manually looping i, then y to find one record, get a couple values, and then onto the next one. Enter dictionaries. Life changing.
Kaz
Kaz
@BrandonBarney I did much the same. With a million-item collection.
@Kaz Lol, I thought my 60k records was bad.
I did have one where I would sort both tables before loading the array, and I would then try to save the LastFoundRecord position, and do some other stuff. It did certainly cut down on time, but it was still a painfully slow loop.
12:05
@SlowLearner His "Always use" statement is concerning... see: chat.stackexchange.com/transcript/message/39295000#39295000
In C#, are ' and " interchangeable? Or do they have special meaning for defining strings?
Also, can I use LINQ on an object[,] or must I convert the object[,] to some form of a class? I am hoping to filter using the headers defined in the first row.
12:20
Grrrr... in Australia we got the NBN... it is a new, expensive, kind of internet to replace the one that works :-(
2
Finally! Australia does something to make the US not as truly terrible! lol
@BrandonBarney felt the same way when I discovered Filter for Arrays
@BrandonBarney then you played the Trump card...
@SlowLearner To this day I dont understand Filter properly lol. I tried using them a few times, was getting some kind of issue, and gave up on them.
@SlowLearner Exactly what I mean lol. Not to get political in here...but...
@Kaz I adapted a timer to a call stack class... gives pretty good results
@BrandonBarney meh... we were having a good chat about guns etc. earlier, can't see what harm bitching about the internet and Trump could do ;-)
@SlowLearner You just never know who supports what party. I definitely dont care for Trump, but I also dont want to be stepping on anyone's toes who might support him.
12:27
@SlowLearner eh? Pro tips please!!
@FreeMan star list? educate me
' NOTE: Use Filter to add unique names to array
' Example:
' - ?ubound(Filter(split("a,a,a,a,a", ","), "a")) will return: 4
' - ?join(Filter(split("a,b,a,b,a", ","), "a"), "-") will return: a-a-a
144 If Not UBound(Filter(arrTblSort, gstrtable)) > -1 Then
146 If arrTblSort(0) = vbNullString Then
148 arrTblSort(0) = gstrtable
150 Else
152 MainLoopIndex = UBound(arrTblSort) + 1
154 ReDim Preserve arrTblSort(0 To MainLoopIndex)
@FreeMan ^^^^
oh and don't mention the HN - that's changing.... RD is helping with that
@SlowLearner Interesting!
@BrandonBarney TBH he's doing better that I expected
Kaz
Kaz
@SlowLearner Ooh, I didn't know VBA had any array functions.
as in, he's still there
12:36
@SlowLearner Just above the list of stars to the right ---> is a link for show all 8047 (note: number subject to change very quickly round these parts!)
... OK now I feel like you're all taking the piss! Glad to be able to contribute something of 'useful' interest :-)
@FreeMan I was afraid that was what you meant... I have a low attention span. Will give it a shot
Kaz
Kaz
@SlowLearner I get annoyed at everyone on "my side" for treating Trump like some incompetent imbecile. I'm like "NO! Do you not get it. This guy went up against the combined political establishment of one of the most powerful countries in the entire world and beat them all anyway. Don't f****** underestimate him."
Yeah, it was a few days ago, too, and I think it was a link to an SO question that had a good discussion on it, so it won't be super obvious. Sorry... Maybe Mug or Thunder will pop in with a better memory than mine & make your life easier.
@SlowLearner I was more thrown by line numbers. Who uses those anymore? It's not like you have to sort your punch cards if you drop 'em...
@Kaz 100% agree with you - I predicted a Trump Govt a few weeks out and ppl thought I was nuts. Erm they still think that... but at least I was right.
Oh.... you should see how big some of the Methods are, they need numbers.
Kaz
Kaz
@SlowLearner The bookies were offering 5:1 the night before. I took them up on the offer.
12:40
@SlowLearner Danger, Will Robinson! Danger!! Incoming Refactor Alert!! DANGER
2
@Kaz They are only really used for error reporting. I have a fogbuz account and it tells me when the code crashes and what line number... pretty handy, quick to fix. I am working on massive refactor... and yes this involves much danger....
@FreeMan erm that was for you ^^^
@Kaz... what I meant to say... was how much did you win... I mean.... were you a true believer?
Kaz
Kaz
Did even better out of the UK election. 6 weeks out, they were offering 100:1 odds of Boris Johnson being PM by the end of election month. Sold that bet the morning after the election at 5:1.
@SlowLearner Put down £100 on Trump.
at 5 to 1 I might not have bet the house, but would have put down the car!
Ok... there's a pretty good show of conviction right there... guessing you're in the UK somewhere?
Kaz
Kaz
@SlowLearner Yep. I make bets not to make money, but because it forces me to be disciplined in my predictions.
It's very easy to say "Oh yeah, I saw that coming". Putting actual money on the line puts some weight behind it.
better than the lotto - people look at me strange when I tell 'em it is a tax for the mathematically challenged...
2
Kaz
Kaz
12:46
@SlowLearner I dunno, it's a far cheaper form of entertainment than going to the cinema.
@Kaz do you have the term "Monday's Expert"... another way of saying 20/20 vision...
Kaz
Kaz
@SlowLearner We have "20/20 hindsight" ^^
Though generally that's not used to describe some specific perosn
@Kaz Dude that is so easy to say in hindsight...
Kaz
Kaz
@SlowLearner Reading through ELU, there's not a single term I've ever heard in the UK that would be a good match.
But yes, this is very much the point. I don't want to go around pontificating on what I think will happen all the time, but I do want some way to prove that I saw it coming.
@Kaz Monday's expert refers to the outcome of the various bouts on the sports fields etc. that are played on the weekend and are invariably discussed in mind numbing detail until the following Friday.
but I figure you picked up on that already
Kaz
Kaz
12:56
@SlowLearner Yep. Can't really recall a phrase I've ever heard (not on an American tv show) that you would use to refer to some specific person.
Mondays Experts song... youtube.com/watch?v=yX7hJhlWAt8
@Mat'sMug oh... 9 days ago. Very good.
@SlowLearner He's doing better than I expected, but that isnt saying much.
Well here in Aus we were wondering how long it would take for him to be "looking the wrong direction"
13:03
@Kaz Agreed. I may not like the guy, but I have always said that he knows how to reach the kind of people who like him. His rhetoric may piss me off, but there is a group of people out there who are thinking exactly the same thing.
Unfortunately, my parents are part of that group of people.
@BrandonBarney ouch
@SlowLearner It can make family time a little uncomfortable, but they have mostly learned to just keep quiet on politics. They've improved a bit as well which is good. The world (and religion) they grew up with though dictated their worldview, and it is very difficult to change someone's perception when they've been seeing in the same "shade" of the world for the last 30 years.
(Not saying my parents are 30. They definitely arent lol.)
lol - and here was me thinking WTF?!...
@Mat's Mug Is there a way to convert an object[] {string} to a string, object[] {double} to double, etc.?
@SlowLearner That would be some F'ed up relationship lol.
Wait, is it as simple as using GetType? I swear that didnt come up the first time I tried the methods in the immediate window.
(Using GetType with a TypeConverter function)
Now if I could just remember why I needed the type conversion...
13:18
@BrandonBarney not sure what you mean
@Mat'sMug I think I figured it out, but basically I have an object[,] and each value in that array is an object with an underlying type. I am working on converting the array into a data table (so I can use LINQ on it) but in order to do that I need to set the types of the property columns, as well as of the individual values.
I ended up doing this Convert.ChangeType(Data[1,1], Data[1,1].GetType()) to convert it to it's underlying type, now I am working on the data table.
Also, there's a very good chance that there is an easier way to get from point A to point B. I am just piecing things together slowly. I can improve the code as I learn.
when in doubt, Code Review :)
I will once I get to that point :).
13:34
@Mat'sMug isn't that what he's doing? ;)
@BrandonBarney In case you didn't get your answer, ' is for characters, and " is for strings.
@Kaz Yup. I don't agree with him half the time, but I certainly don't think he's an incompetent idiot.
He brought liberal MN over to the point of being where the Republican's could have forced a recount.
@BrandonBarney Question: have you been keeping quiet on politics too?
@Hosch250 only thing worse than an incompetent idiot is a competent one...
(sorry couldn't help self)
@ThunderFrame Amen. Preaching to the choir on that one for sure :)
@BrandonBarney Worse if your uncle is your sisters brother
13:49
@BrandonBarney Unless I'm misunderstanding you, you can use a For Each on a dictionary. For Each varKey in dictName
@puzzlepiece87 that defeats the purpose of using a dictionary though.
@Hosch250 Yeah. If I dont bring it up, they dont bring it up. It makes things much easier. I occasionally post on FB, but for the most part I just sit and listen.
@puzzlepiece87 I need For each Foo in Dict.Keys which can't be done (unless I am mistaken).
@Mat'sMug that is something I don't understand.... sometimes I feel the need too see what is in a dictionary other times I want to know what something is... defeats? Me thinks augments? Or am I missing something?
@BrandonBarney No, you can definitely loop the keys (and items). One second, let me confirm my exact code.
@puzzlepiece87 If the Key is an Object which defeats the purpose of a Key.
13:59
@Mat'sMug @SlowLearner is right. It only defeats the purpose of a dictionary if you already know what's in the dictionary. If you don't, being able to loop the keys is a big help.
@puzzlepiece87 Dictionary.Keys is an array
@puzzlepiece87 Assume something like Dict.Add sID, Student (using HN to help illustrate). Do that a few times and then try For each sVar in Dict.Keys. You'll get an error.
+1 to Mat's Mug as well. You can return an array of Keys() or Items(). It isnt a Collection.
@BrandonBarney For Each varKey In dictCorrectionOptions.Keys() is what I had
@BrandonBarney I have used this ^ several times before.
Wait a second. I'm being dumb here. That's what I do. I just forgot that you have to use a Variant type.
@BrandonBarney If s stands for string, that's not right, you have to use a variant.
14:04
You can't do For each String even if all keys are strings.
@BrandonBarney Exactly :)
Don't mind me. I'll just go hide in shame lol.
@BrandonBarney Brothers in code :)
And yeah, it does somewhat undo the point of a dict (if you're looping through all of them), but frankly it is one of those bad habits where I just like to have all of my Collections as Dicts unless a Collection is necessary :).
lol and here was me thinking that 's' should have been 'str'....
14:05
Largely because I dont want to add duplicate records :)
@BrandonBarney filter
@Mat'sMug This interests me, it sounds a bit nicer. Are you saying you can do For lngIndex = Lbound(dictName.Keys) to Ubound(dictName.Keys)?
@SlowLearner Since Hungarian notation isn't a good practice, they're both equally wrong lol.
@SlowLearner I don't use s or other one letter Hungarian because it would be wrongly confused with apps Hungarian that people should use, where s stands for safe.
@SlowLearner For my purposes Dict's just make sense. It is much easier for me to say If Not Dict.Exists(Key) Then Dict.Add Key, Student than to figure out how to use the filter in such a way that can do what already is done very quickly.
safe... ??? OMG just when I thought I was keeping up. Safe what... I keep a usb key in a safe.
@BrandonBarney yeah I do that too, lots.
@SlowLearner Such as sPrompt vs usPrompt where an usPrompt could contain a command that could execute if printed to a message.,
Fire alarm. sigh
14:09
@puzzlepiece87 No, but you can do For Index = Lbound(Name.Keys) to Ubound(Name.Keys)!!! Grrr....
@BrandonBarney @SlowLearner @Mat'sMug You can't use .Exists() in a collection, right? So that's why I would still use a dictionary instead of a collection. And then again, I'm looping through the keys because sometimes I don't know what's in the dictionary.
@FreeMan @SlowLearner This is what I am referring to, and tl;dr - a variable that is safe is one that has been confirmed to be of the type you think it is, to prevent stuff like SQL injection.
@puzzlepiece87 here:
If NOT myDictionary.Exists(myNewItem) then
  myDictionary.Add myNewItemKey, myNewItem
end if
@puzzlepiece87 that's fine - just remember that you're iterating an array
14:12
then you don't need to know what's in the dictionary
@FreeMan LOL - Blistering Barnacles, we’ve got to get some consistent coding conventions around here!
@FreeMan How I used it:
Function FixesActiveCount() As Long

    FixesActiveCount = 0

    Dim varKey As Variant
    For Each varKey In dictCorrectionOptions.Keys()
        Dim lngCorrectionTypeRow As Long
        lngCorrectionTypeRow = CorrectionTypeOptions.Columns(1).Find(what:=varKey).Row
        If CorrectionTypeOptions.Shapes("ToggleBackground" & lngCorrectionTypeRow - 1).TextFrame.Characters.Text = "On" Then
            dictCorrectionOptions(varKey).boolActive = True
        Else
            dictCorrectionOptions(varKey).boolActive = False
I would love to hear about this downvote. — Mat's Mug 5 mins ago
sometimes I wonder wtf is wrong with the world
then I have a coffee and get back to work
@puzzlepiece87 You could reverse the logic of that to go through all your CorrectionTypeOptions.Shapes and set the appropriate dictionary entries as appropriate. Not necessarily better, but an option.
@Mat'sMug The answer was too much better than all the other answers.
14:20
I suppose a wall of ready-to-paste VBA code makes a "better" answer than a need-to-adjust-as-needed number format.. for some.
@Mat'sMug The vampires demand a blood bank.
@FreeMan For the sake of saying why it would need to be that way only, though it doesn't apply to that particular example from my code, that reversal would only work if all the shapes had a corresponding dictionary item.
@FreeMan But you are definitely right for that example :) I have others where it's more ambiguous.
@FreeMan that really is an interesting article - love the writing style; thanks :-D
@Mat'sMug My only guess is that it was posted so long after the OP? Otherwise, someone is just in a bad mood and wants to be a jerk.
@Mat'sMug I want to make sure I fully understand this comment since it's important. How should I apply the knowledge of keys being an array?
@puzzlepiece87 by not iterating it with a For Each loop ;-)
14:27
@Mat'sMug So you're saying that For lngIndex = Lbound(dictName.Keys) to Ubound(dictName.Keys) is possible?
@BrandonBarney mwell, there's 2 badges awarded for answering old posts. besides the other answers all involved brittle, painful solutions. the shapes one is particularly terrible IMO.
@puzzlepiece87 /s/possible/recommended
@FreeMan oh... hey ...sSomething = good. Got it now... thanks
@puzzlepiece87 You could also do For i = 1 to Dict.Count since the Array is always 1-Based. You just have to check to ensure there is a key existing in the dict before iterating.
@BrandonBarney Good. I hate "shut up and listen to me" type of people.
@SlowLearner Depends on your needs and the conventions in your office, but yeah. You're welcome. Keep that site bookmarked - you'll refer others to it, too.
14:41
Thanks mate.... just realised it is Wednesday morning FFS - I gotta sleep.
Nite all
thanks
@Mat'sMug Thanks for teaching me that. I like that much better than varKey. (I just finished testing the array bounds method)
15:02
oh you gotta be kidding
    loop1 = True

    Do While loopl = True
Use Option Explicit, and above all avoid using l and 1 as identifier suffixes. FWIW Rubberduck would have warned you about loopl not being declared and loop1 never being used. — Mat's Mug 1 min ago
lol
Am I correct in that GetUpperBound(0) is the equivalent of UBound(SomeArray, 1) and GetUpperBound(1) is the equivalent of UBound(SomeArray, 2) ?
C# vs VBA
15:20
what else could it be?
I just wasnt sure that the indices of the dimensions were correct. In VBA the dimension is one based whereas C# it seems to be 0 based?
nothing is 1-based in C#
Good to know :)
16:07
@Hosch250 @Mat'sMug How much experience with C# do you think is necessary to get the most out of Dependency Injection in .NET? I'm not grasping the ideas and wanted a ballpark knowledge level to know when to go back and try it again.
no idea
it's more about programming than it is about C#
what concept are you struggling with?
Mostly all of chapter 2. I read it and only understood a part of it.
okay I read that book over two years ago.. what's in ch.2 again?
It's the example of doing it wrong and then doing it right.
architecture
IoC
16:13
I think so.
Data Layer, Domain Layer, User Interface Layer.
> In addition to variable/enum name collisions, the VBE allows a name conflict to be created (and saved) between an Enum type name and a ClassModule name. The good news is that the Enum/Class name conflict is identified by the VBE when closing the editor/Excel. That said, the user can still click 'OK' when closing the editor, and the conflict is allowed to persist.

I'm looking for some input on this issue. I have code that adds the inspection to detect an existing name conflict between an
I've never worked with anything like that so it's all foreign to me. I lack a point of reference with which to orient myself.
each "layer" is a separate .net assembly
or "project" in a "solution"
projects have references
that chapter discusses the direction of these references
16:29
Why would I get an IndexOutofRange on a Break statement?
uh, dafuq?
Exactly what I am trying to figure out lol
what's the stack trace?
at AnalystTools.DataContainer.GetColTypes(Object[,] InputData) in C:\Users\b.barney1\Desktop\Macro Workbook\VB Net Testing\AnalystTools\AnalystTools\AnalystToolsRibbon.cs:line 87
   at AnalystTools.DataContainer..ctor(Object[,] InputData) in C:\Users\b.barney1\Desktop\Macro Workbook\VB Net Testing\AnalystTools\AnalystTools\AnalystToolsRibbon.cs:line 57
   at AnalystTools.AnalystToolsRibbon.TableFilter_Click(Object sender, RibbonControlEventArgs e) in C:\Users\b.barney1\Desktop\Macro Workbook\VB Net Testing\AnalystTools\AnalystTools\AnalystToolsRibbon.cs:line 45
@BrandonBarney your lowerbound is always going to be 0
looks like an off-by-one
16:32
@Mat'sMug Habit from VBA lol. Ill fix that though.
weird that it breaks there
No need for +1
also, ; j < inputData.Length would be much simpler
@IvenBach The +1 is to loop starting in the first data row. 0 is a header row.
I stand corrected.
16:33
Does length always refer to number of rows?
length is the number of elements in the array
so yeah
oh wait, you have a 2D array. ...good question.
I pretty much never needed to use that
:39301277
Damnit, I was trying to quote it lol
4 mins ago, by Mat's Mug
@BrandonBarney your lowerbound is always going to be 0
I guess its one of those cases of Excel being an exception to the rule
ah, yes.
16:38
When I asked a co-worker about C# lowerbound being non-zero he got an extremely confused look on his face.
Length doesnt work for this :)
Figured it out. Types was declared as object[GetUpperBound(1)] which actually makes it n-1 for the actual number of dimensions I need.
Nope, still get an error. At least I know it isnt the number of dimensions in Types.
Oh I get it now. That's stupid (it actually makes sense). Since Types is 0 based and InputData is 1 based, I have to do i - 1
17 mins ago, by Mat's Mug
looks like an off-by-one
You were right, i just couldnt find where the off by one was :/. I'll get used to C# eventually.
The worst part about that though is if this was VBA I would've known immediately where it was.
17:03
Type is one of those words where, the longer you stare at it, the more certain you become that you're spelling something wrong.
17:18
aye. I could have sworn the real spelling was Tipee
17:31
@IvenBach Give a few months and try again. I had two years of RD under my belt before I read it.
@Mat'sMug I'm pretty sure that's "Kiss".
Read C# In Depth. The chapters about Linq and async/await might be a little tricky, but not as mind-changing as DI.
00:00 - 18:0018:00 - 00:00

« first day (1159 days earlier)      last day (2021 days later) »