« first day (1495 days earlier)      last day (1685 days later) » 

00:00
I do think people would take him more seriously if he actually wrote something that was demonstrably better than SQL. He tried but it never really took off, so....
RELOAD!
[FreezePhoenix/XtraUtils] 1 commit. 283489 additions. 44 deletions.
[rubberduck-vba/Rubberduck] 1 opened issue. 1 issue comment.
hmm. this is interesting....
Given a ThisWorkbook defined with this code behind...
Public Function A1() As String
    Debug.Print "A1 called"
End Function
in standard module:
Public Sub f()
    ThisWorkbook.A1     'OK
    ThisWorkbook.[A1]   'OK
    ActiveWorkbook.A1   'OK
    ActiveWorkbook.[A1] 'runtime error 438
End Sub
Verified that ThisWorkbook Is ActiveWorkbook returns true prior to running, which is redundant because of the 3rd test working. So why won't 4th syntax work?
00:19
[rubberduck-vba/RubberduckWeb] retailcoder pushed commit c5ef3c02 to master: removed "won't work in all hosts" notice
00:36
> Just to be clear, this is what happened when I attempted to add a 2nd Test Method using the Test Explorer UI.

I can confirm that happens when the cursor is located:
- Above
- Inside, or
- Below

the original Unit Test.

Word 2010, Rubberduck v2.2.0.3468-pre

```
'@TestMethod
Public Sub ValidateIndexOneIsLevel1() ' Expected: IsValid = True
On Error GoTo TestFail

'Arrange:

'Act:

'Assert:
Assert.Inconclusive

TestExit:
Exit Sub
Tes
01:04
> Just want to comment that this needs not be a runtime error, because it is possible to define a function on the workbook named `A1`, which would allow `ThisWorkbook.A1` and `ThisWorkBook.[A1]` to execute. However, with `ActiveWorkbook.[A1]` and `Application.Workbooks(1).[A1]`, we still get runtime errors, even though the non-bracketed counterparts will work.

I think the usage of brackets on its own is suspect, regardless whether it's used for evaluation or as a late bound call since it con
> Just want to comment that this needs not be a runtime error, because it is possible to define a function on the workbook named `A1`, which would allow `ThisWorkbook.A1` and `ThisWorkBook.[A1]` to execute. However, with `ActiveWorkbook.[A1]` and `Application.Workbooks(1).[A1]`, we still get runtime errors, even though the non-bracketed counterparts will work.

I think the usage of brackets on its own is suspect, regardless whether it's used for evaluation or as a late bound call since it con
01:16
Any prefer research things to find out more Cohesiveness @Vogel612?
 
3 hours later…
03:59
> F5 and Unit tested. I've updated the PermissiveAssertClass to have it treat numeric comparisons as VBA does. It behaves as I expect it for numbers. Is there anything that I've missed? Below are the tests I used to compare against: ``` 'Module1 Public Function InputHasMoreThan5Characters(ByVal value As String) As Boolean InputHasMoreThan5Characters = Len(value) > 5 End Function Public Function ReturningANumber() As Long ReturningANumber = 10 End Function ``` ``` PermissiveTestModule1 Public...
Sub ModuleInitialize() 'this method runs once per module. Set Assert = CreateObject("Rubberduck.PermissiveAssertClass") Set Fakes = CreateObject("Rubberduck.FakesProvider") End Sub '@TestMethod Public Sub TestingShortInput() On Error GoTo TestFail 'Arrange: 'Act: Dim shortInput As Boolean shortInput = Module1.InputHasMoreThan5Characters("quack") 'Assert: Assert.IsFalse shortInput TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub...
'@TestMethod Public Sub TestingLengthyInput() On Error GoTo TestFail 'Arrange: 'Act: Dim lengthyInput As Boolean lengthyInput = Module1.InputHasMoreThan5Characters("More than 5 characters") 'Assert: Assert.IsTrue lengthyInput TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub '@TestMethod Public Sub TestingAreEqual() On Error GoTo TestFail 'Arrange: Dim foo As Long foo = 10 'Act: 'Assert: Assert.AreEqual 10, CByte(10) TestExit:...
Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub '@TestMethod Public Sub TestingAreEqualStrings() On Error GoTo TestFail 'Arrange: Dim bar As String bar = "barbarbar" 'Act: 'Assert: Assert.AreEqual "barbarbar", bar TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub '@TestMethod Public Sub TestingSequences() On Error GoTo TestFail 'Arrange: Dim expected(1 To 5) As String...
expected(1) = "Foo" expected(2) = "Bar" expected(3) = "Baz" expected(4) = "Duk" expected(5) = "End" 'Act: Dim actual() As String actual = ExampleArray 'Assert: Assert.SequenceEquals expected, actual TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub Private Function ExampleArray() As String() Dim temp() As String ReDim temp(1 To 5) temp(1) = "Foo" temp(2) = "Bar" temp(3) = "Baz" temp(4) = "Duk" temp(5) = "End" ExampleArray = temp...
End Function '@TestMethod Public Sub TestIsNothing() On Error GoTo TestFail 'Arrange: Dim foo As Worksheet Set foo = Sheet1 'Act: 'Assert: Assert.IsNotNothing foo TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub '@TestMethod Public Sub TestingAreSame() On Error GoTo TestFail 'Arrange: Dim foo As Worksheet Set foo = Sheet1 Dim bar As Worksheet Set bar = Sheet2 'Act: 'Assert: Assert.AreNotSame foo, bar TestExit: Exit Sub TestFail:...
Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub ``` ``` StrictTestModule1 '@ModuleInitialize Public Sub ModuleInitialize() 'this method runs once per module. Set Assert = CreateObject("Rubberduck.AssertClass") Set Fakes = CreateObject("Rubberduck.FakesProvider") End Sub '@TestMethod Public Sub TestingShortInput() On Error GoTo TestFail 'Arrange: 'Act: Dim shortInput As Boolean shortInput = Module1.InputHasMoreThan5Characters("quack") 'Assert:...
Assert.IsFalse shortInput TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub '@TestMethod Public Sub TestingLengthyInput() On Error GoTo TestFail 'Arrange: 'Act: Dim lengthyInput As Boolean lengthyInput = Module1.InputHasMoreThan5Characters("More than 5 characters") 'Assert: Assert.IsTrue lengthyInput TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub '@TestMethod...
Public Sub TestingAreEqual() On Error GoTo TestFail 'Arrange: Dim foo As Long foo = 10 'Act: 'Assert: Assert.AreEqual CLng(10), foo TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub '@TestMethod Public Sub TestingAreEqualStrings() On Error GoTo TestFail 'Arrange: Dim bar As String bar = "barbarbar" 'Act: 'Assert: Assert.AreEqual "barbarbar", bar TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " -...
" & Err.Description End Sub '@TestMethod Public Sub TestingSequences() On Error GoTo TestFail 'Arrange: Dim expected(1 To 5) As String expected(1) = "Foo" expected(2) = "Bar" expected(3) = "Baz" expected(4) = "Duk" expected(5) = "End" 'Act: Dim actual() As String actual = ExampleArray 'Assert: Assert.SequenceEquals expected, actual TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub Private Function ExampleArray() As String() Dim...
temp() As String ReDim temp(1 To 5) temp(1) = "Foo" temp(2) = "Bar" temp(3) = "Baz" temp(4) = "Duk" temp(5) = "End" ExampleArray = temp End Function '@TestMethod Public Sub TestIsNothing() On Error GoTo TestFail 'Arrange: Dim foo As Worksheet Set foo = Sheet1 'Act: 'Assert: Assert.IsNotNothing foo TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub '@TestMethod Public Sub TestingAreSame() On Error GoTo TestFail 'Arrange: Dim foo As...
Worksheet Set foo = Sheet1 Dim bar As Worksheet Set bar = Sheet2 'Act: 'Assert: Assert.AreNotSame foo, bar TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description End Sub ```
@Pond forgive any naivete on my part.
04:12
[rubberduck-vba/Rubberduck] build for commit 4f07e756 on unknown branch: AppVeyor build succeeded
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4170?src=pr&el=h1) Report
> Merging [#4170](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4170?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/debf4a6bc809b79fa70428de598b6913b068905d?src=pr&el=desc) will **increase** coverage by `0.08%`.
> The diff coverage is `93.75%`.


```diff
@@ Coverage Diff @@
## next #4170 +/- ##
=======================
[rubberduck-vba/Rubberduck] build for commit 4f07e756 on unknown branch: 52.52% (target 0%)
04:25
[rubberduck-vba/RubberduckWeb] retailcoder pushed commit 7bfa3091 to master: updated RD 2.2.0 build; updated Nuget packages to new requirements; removed InspectionsController.Details, added table to InspectionsController.List, with an
> rubberduckvba.com/build/version/stable now reports 2.2.0.0, and next green release I'll make sure to have build 2.3.0.0 online so that this doesn't happen again.
> An inspection to alert about any bracketed expression might be a little to loose. More like inspection to alert about any bracketed expression that doesn't require square brackets., as there are Enums, Enum members and externally defined members that either have special characters, or are treated differently by VBA (eg. [Global] - see #4164 ).
05:00
Hello Pond. Anyone know where I can find which methods are implemented by late bound HTMLFile i.e. if I do CreateObject("HTMLFile") which methods are exposed please?
05:11
What's the early binding for it?
Project website is back up! ...with an updated inspections list! http://rubberduckvba.com/Inspections/List
You can reference the mshtml dll , and look in object browser?
Library MSHTML
C:\Windows\SysWOW64\mshtml.tlb
Microsoft HTML Object Library
^ that's on 32-bit office
@QHarr ^^
05:29
@ThunderFrame Hi!
Thanks. So, simply tools >references and tick the mshtml lib ?
Or do I need to locate and load?
I guess I could just look!
:scuttles off:
Ok. I can't see it immediately. I will have a look at the path you suggest (I am 64 bit)
@ThunderFrame I get a cannot add reference message when browsing and attempting to add :-(
@QHarr you shouldn't need to browse - it should bin the References list as "Microsoft HTML Object Library"
Oh...I have that. But I didn't realise that would let me view the late bound methods in the object browser. What object would I be looking for then in the object browser? Apologies for perhaps basic question.
strange that you get an error. any other error detail?
@QHarr change the library to MSHTML in the object browser's drop-down (top left) and you can see the members. HTMLDocument is a class in there.
Full text was "Can't add a reference to the specified file."
do you need to have it be late-bound? Microsoft paid a massive anti-trust settlement in order for every PC to have MSHTML/IE installed.
@QHarr I don't understand. You have a reference to Microsoft HTML Object Library, or you don't?
05:41
But doesn't that show me the early bound methods? I am thinking specifically of the fact I can do querySelectorAll with early bound HTMLDocument but I cannot with CreateObject("HTMLfile"). The latter doesn't expose an interface having this method, but I don't know how to find out which methods it does expose.
I can do early binding. This is about code written to hand-off where people can't add references.
What is an anti-trust settlement? :Googles:
why not just send them the xlsm complete with the references? Are you asking them to copy/paste the code? That souunds like asking for trouble if they don't know how to add references, but you could add a helper function for adding references programatically.
Function querySelectorAll(v As String) As IHTMLDOMChildrenCollection
Member of MSHTML.HTMLDocument
United States v. Microsoft Corporation, 253 F.3d 34 (D.C. Cir. 2001), is a U.S. antitrust law case, ultimately settled by the Department of Justice (DOJ), in which Microsoft Corporation was accused of holding a monopoly and engaging in anti-competitive practices contrary to sections 1 and 2 of the Sherman Antitrust Act. The plaintiffs alleged that Microsoft abused monopoly power on Intel-based personal computers in its handling of operating system and web browser sales (for at the time web browsers were not freeware, but payware). The issue central to the case was whether Microsoft was allowed...
The problem specifically occurs with solutions for OPs that state their employeers will not allow them to add references.
I don't worry internally as I know everyone in my org will have HTML Object library so I can just go ahead and add the reference.
But yes, adding reference via helper might be an option. I don't know whether that can be blocked or not.....
@QHarr but the code is already installed on the machine, and can be called late-bound. adding a reference is not installing anything.
@ThunderFrame True
It just feels.. naughty
@QHarr but that's what I'm saying, MSHTML is on every PC.
adding a reference to a VBA project is not installing anything - it is not naughty.
05:47
:-)
I think, for the scenario of OP doesn't have HTML Object library referenced and claims they aren't allowed to add references, that I may have to try for the helper function to add the reference.
Appreciate the help.
Is there no way though to know what methods the late bound object exposes? (I'm so sorry if I have missed something!)
If you have SAP installed, and can reference a SAP type library, that's allowed, but if you distribute your code to somebody that doesn't have SAP, you're out of luck, and IT policy will rightly block them from installing SAP without a licence. But if you distribute an XLSM with a reference to MSHTML, you don't have to worry, it's already on their PC.
@QHarr How do they receive your code? You send them the text, or you send them an XLSM?
If it is an OP, they just get a text code version in the answer. IRL, I don't have this problem as, as you say, I just add the ref and distribute.....
OP = Original Poster for a Stack Overflow question?
Yah
I should have made myself clearer. I apologise.
It seems to me that an OP that says "my employer doesn't let me add references" is confusing himself/herself with the truth "my employer doesn't let me install software"
MSHTML is already installed.
05:53
Possibly though I have heard people say that the reference menu is greyed out.
If your employer truly didn't allow you to add references, then CreateObject is just a one-line workaround, and would be a violation
I don't have enough experience to judge what is and isn't the truth on these things.
@ThunderFrame I hadn't thought about that.
@QHarr I've never seen or heard of that
if you want to add a reference programmatically, the user will require permissions to automate the VBE
05:56
I'm wondering if they were confused with macros being disabled.
this will add a reference for MSHTML for 32-bit Office
In which case nothing would run anyway!
ThisWorkbook.VBProject.References.AddFromFile "C:\Windows\SysWOW64\mshtml.tlb"
Many thanks.
I am going to go frolic in some soothing CSS...Appreciate the help.
@QHarr It's definitely possible to install Office without VBA. In fact, with WordPerfect Office, VBA is an additional install, after you've completed the original setup.
.reference {
  display: none;
}
hehe
06:19
:-)
:frolics (sp?) off:
@ThunderFrame would you mind reviewing my PR for the PermissiveAssertClass?
06:57
@IvenBach sure. AFK ATM, looks like I might need a bigger screen. Later...
 
4 hours later…
 
1 hour later…
11:57
> It would nice to see some more tests on arrays (right now you only test `String` arrays)
- comparing an `Empty` `Variant` to a value of `""` or `vbNullString`
- some array values having a value of `""` and/or `vbNullString`
- comparing a `Variant` array of strings to a `String` array
- comparing a `Variant` array with a mix of `Long`, `Integer`, `Byte`, `Decimal`, `Currency`, `Double`, `Single`, `Boolean` and `Date`
- Comparing a `Byte` array to a `Long` array

And some tests involving
12:08
hmm, if vbNullString is marshalled as a null, then how can AssertClass compare vbNullString and Null (i.e. what does Null get marshalled as?)
12:46
@ThunderFrame I believe that is somewhat incorrect. The type in C# is object, which basically means it gets similar treatment to a variant. Since the StrPtr(vbNullString) will equal 0, it gets converted into C#'s null (e.g. zero pointer). In contrast, a VBA Null is a variant with VT_NULL flag set. Same thing applies to the Empty - it's a variant with VT_EMPTY flag set.
In order to get that information, the parameters must be marshaled as a IntPtr to access the raw VARIANT structure so that you can access the type before you access the value.
@this I see. Just as long as that information survives the marshall, so you get these results:
?vbNullString = Empty
True
?vbNullString = Null
Null
Correct. That's why I think the marshaling there is wrong
I guess we'll see, once @IvenBach implements my test suggestions in the #4170 comment
but it might also require a change to the AssertClass.
13:05
> I believe this is wrong:

https://github.com/rubberduck-vba/Rubberduck/blob/d533a968cc883cc2347e16dc039913cfde9b0e80/Rubberduck.Main/ComClientLibrary/UnitTesting/AssertClass.cs#L126

In order to accurately evaluate whether the value is `Empty` or `Null`, we must be able to access the underlying information stored in the `VARIANT` structure. To do this, I think we need to modify the signature as following:

```
public void AreEqual(
[MarshalAs(UnmanagedType.Struct)] VARIANT expected,
 
4 hours later…
16:41
@ThunderFrame Also, I think it should be noted that I believe there's implicit casting going with using Empty in any comparison. vbNullString = Empty and 0 = Empty both evaluates to True but obviously vbNullString = 0 won't work out. As such, it is impossible to compare Empty to anything else because of all the black voodoo implicit conversion being applied to Empty in order to compare it to the other thing.
> @bclothier then the IAssert interface needs to be changed, and the AssertClass implementation needs to reflect it too.
17:03
@Duga sounds like a "one step at a time" thing.
I think we can merge Iven's PR as a stopgap solution that fixes the majority of the currently existing problems and then update the Assert implementations in another PR
that said, I won't be working on RD much in the coming week
@Vogel612 you can't change the implementation's signature and have it work through the interface, and you can't change the interface's signature and have it compile without changing both implementations..
exactly my point.
I'm advocating to not touch both implementations in that PR, but to do that in a separate PR
yeah makes sense
17:06
as long we stick in TODO / open an issue, I'm good.
let's say as long as we open a follow-up issue and I'm with you
17:19
> German translations for Autocompletion Settings
> As a discussion from the PR #4170, which is outside the PR's scope, we need to make changes to the `IAssert` interface.

Currently we have:
```
void AreEqual(object expected, object actual, string message)
```

Which probably works OK for the normal `Assert` class but is inadequate for `PermissiveAssert` class. The reason is that as a part of marshaling a variant to the `object`, the data content of the `variant` is read into the `object`, erasing any metadata that we have about the var
@Vogel612 ^ there ya go.
@this :+1:
17:33
@this According to the VBA spec, a comparison with a variable of value type Empty is always performed in the other operands value type, with two exceptions: a Boolean and Empty as well as two variables of value type Empty are compared as Integer.
Moreover, the declared return type of comparing a Variant with anything is Variant, not Boolean.
Since let coercing Empty to Integer yields 0, comparing a Variant of value Empty with 0 returns a Variant of value True.
@Duga @this what is "Marshaling" exactly? I hear it used but don't understand what it entails.
@M.Doerner Yes that's one of the danger with the all those implicit conversions VBA does for you - when it's part of multiple expressions, the results can work out unexpectedly
AFAIU, it is converting the VBA (unmanaged) type into a .Net type.
Correct. All unmanaged types must be marshaled -- there is a default marshaling system, in which case, the VARIANT gets marshaled into .NET's object
but if you want more control over how you receive/send the data type, you can use MarshalAs to tell the RCW/CCW how you really want to get/send it.
Of course, once you specify MarshalAs, you better use it correctly because it's basically unsafe.
It's being converted from unmanaged to a managed type?
17:40
[rubberduck-vba/Rubberduck] build for commit 362918e9 on unknown branch: AppVeyor build succeeded
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4171?src=pr&el=h1) Report
> Merging [#4171](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4171?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/debf4a6bc809b79fa70428de598b6913b068905d?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.


```diff
@@ Coverage Diff @@
## next #4171 +/- ##
==========================
That's just dealing with memory management and garbage collection?
[rubberduck-vba/Rubberduck] build for commit 362918e9 on unknown branch: 52.44% (target 0%)
Yes. The idea is that you should not be managing the memory allocation of unmanaged types. .NET runtime will do that for you.
And different conventions for laying out data in memory.
Strings come to mind in that regard.
Because when you do it manually, then you are bound to follow the conventions as specified in the underlying APIs -- some API may insist that you allocate the memory yourself, some other may hand you a pointer to memory it already has allocated but insist that you clean up it yourself.
Yet other may hand you a pointer and expect you to not even try to deallocate it all.
17:43
^ And that's what .NET is doing
With marshaling, all those complexities of memory management is abstracted away so you don't need to worry about. Yes.
:+1: Thanks.
17:56
#TIL not to forget about '@ModuleInitialize for unit tests. ignoranceLevel--
18:21
CDec() comes up as identifier text and not keyword text.
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4171?src=pr&el=h1) Report
> Merging [#4171](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4171?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/debf4a6bc809b79fa70428de598b6913b068905d?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `20%`.


```diff
@@ Coverage Diff @@
## next #4171 +/- ##
==========================
[rubberduck-vba/Rubberduck] build for commit 6ce76af1 on unknown branch: 52.43% (target 0%)
[rubberduck-vba/Rubberduck] build for commit 6ce76af1 on unknown branch: AppVeyor build succeeded
18:43
monking @all! Europe has had to go back to surviving without my presence. Prolly not a lot of time to spend loitering about here over the next few days as I dig out from all the stuff that piled up whilst I was gone, but I'll be back in the evenings (EDT), I've got some C# to start learning (and a resume to brush up).
(considering the age of most of the things we saw in Europe while there, I think it'll be fine without me.)
@FreeMan I've got a 2 PR differential advantage on you. P.S. welcome back
yeah, well, I'll get caught up sooner or later. ;)
thanks
-1
Q: How to Condense my Repetitive Code Excel - VBA

Darrell RipkowskiHere is the main code that is repeated 30 times for 30 different check boxes The only Lines that Change per CheckBox are the Following The First Line - CheckBox3.Value (will increase by 1 for every checkbox) Fourth Line from Bottom - Cells(eRow, 24).Value = Controls("CheckBox" & 3).Caption (Ne...

19:08
@ThunderFrame Your date and boolean tests thoroughly broke my assumptions.
3
I don't know how to go about fixing them either. Every step I take leads me to a dead-end.
19:34
when Eric Lippert puts you back in your place... #CrawlsBackIntoHole
@MathieuGuindon: No no no, "scope" has a very specific meaning in C#. Scope is the region of program text in which a particular entity can be accessed by its unqualified name. The correct way to think about it is that a block statement introduces a local variable declaration space, and that the scope of local variables immediately within that declaration space is the text of the block. These things are obviously strongly related, but they are logically different, so do not conflate them. — Eric Lippert 14 mins ago
19:46
I think Eric's subsequent comment made it more clearer. I can easily have made the same conflation of block == scope because it's the most visible aspect of scoping.
thing is, I know block != scope and I didn't mean to come across as conflating the two
Well rest assured I would have. I conflate things all time. :o
either way, while(condition) ; is just plain dumb code
well, I did use while(;;) once....
BTW not sure if y'all noticed, I killed the /inspections/details page and moved the descriptions to the /inspections/list, added the actual Inspection.AnnotationName and hash-links to every inspection
eventually I'll get the thing to correctly load the defaults and display them in collapsible (accordeon) groups, by inspection type
useless at the moment, since everything is Warning and CodeQualityIssue
19:52
@MathieuGuindon Look into Bootstrap for the accordion structure.
sure
I also need to swiftly kill Ninject on RubberduckWeb - almost failed to deploy on time because of package dependencies and Castle.Core requiring one version for RD and another for Ninject (updated Ninject and all was good, but I don't want to be stuck in that place going forward)
@MathieuGuindon Want me to redo the website on .NET Core?
It's got DI built in.
@MathieuGuindon swiftly kill Ninject ... like a ninja?
@Hosch250 how will that work with a reference to Rubberduck.dll?
Hmmm. That may not work, since RD isn't built on .NET Core.
@MathieuGuindon Beat me to it.
19:57
What is a VBA Date considered in C#? Double?
do you need to? I thought .NET core can call DLL methods on a .NET FX DLL?
Yes, @IvenBach
that said I think RD-Web could afford to only reference Rubberduck.Resources and Rubberduck.Inspections at this point (now that the online inspector is long gone)
much cleanup is needed
Thunderframe has me stumped as to how to compare stringly-date's with real dates.
smh... What am I thinking they RTE13.
@IvenBach TBH, I'm thinking the best way is to use the variant functions I linked to in the issue.
That way you get 100% fidelity and less implementing the comparison yourself.
20:01
the bad is that you really need that IntPtr/VARIANT and not a lousy object.
I don't know where to begin with them, let along how to properly use thim.
Yeah. I think that for this PR, you can add Ignore attributes to the tests
I don't want to abandon the PermissiveAssertClass just because the update requires more work. I don't think I'm capable of understanding what needs to be done.
and in subsequent PR, someone will finally write a proper evaluation engine that is 100% faithful to the spec of VBA & variant.
I know I can't do that. I don't fully understand everything that requires.
20:04
In fact, I'm wondering if we really should be using all those functions. Both versions of our fake expression engines doesn't even try to use that and they both fall short of the specs.
@this For my education what is the ignore attribute and how is it properly used?
adding [Ignore] to the unit test simply make test engine skip that one over
that's why you get some tests yellow, rather than green.
So write out everything as it would be expected as a unit test, then as a last step [Ignore] it?
yeah
you said you already wrote the tests, no?
Basically it shows we intend to make it work correctly at some future point? Duck checking.
I have some tests in VBA. I haven't written the tests in C#.
20:09
yeah woudl be nice to have those set up so when that nice person writes that much needed PR for evaluation engine, they'll use those.
I'll try and write them up in C#.
I misunderstood ThunderFrame's comment.
@M.Doerner what do you think of using the functions defined here to provide us with our evaluation expression engine? Seems that implementing those would offer better infidelity than if we tried to implement the expression evaluation ourselves, no?
33 mins ago, by this
Well rest assured I would have. I conflate things all time. :o
infidelity, fidelity, only 2 letters, big whoopee. Don't sweat it, man.
dope pope rope nope
:)
20:49
I feel so lost in VS compared to the VBE.
At least I can muddle my way through VS now.
21:07
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4170?src=pr&el=h1) Report
> Merging [#4170](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4170?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/debf4a6bc809b79fa70428de598b6913b068905d?src=pr&el=desc) will **increase** coverage by `0.08%`.
> The diff coverage is `93.75%`.


```diff
@@ Coverage Diff @@
## next #4170 +/- ##
=======================
Boolean tests are in. I can't figure out how to write the others.
21:21
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4170?src=pr&el=h1) Report
> Merging [#4170](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4170?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/debf4a6bc809b79fa70428de598b6913b068905d?src=pr&el=desc) will **increase** coverage by `0.08%`.
> The diff coverage is `93.75%`.


```diff
@@ Coverage Diff @@
## next #4170 +/- ##
=======================
[rubberduck-vba/Rubberduck] build for commit be069865 on unknown branch: 52.52% (target 0%)
[rubberduck-vba/Rubberduck] build for commit be069865 on unknown branch: AppVeyor build succeeded
21:43
In reading Professional Excel Development, it goes over naming conventions. Prefixes g for global, m for module, and no prefix for procedure level. Is this a holdover or something that's still has merit?
it's basically Hungarian Notation Reloadedâ„¢.
I sorta-kinda-but-not-really see the benefit or g/m for global/module. But if things are written clearly I don't think they're needed.
and if you use Mat's Methodâ„¢, it makes it explicit without the prefix anyway.
I've been using a standard module named PublicVariables and whevenever I need a quick'n'durty fix for something I throw them in there. Doubly identifying it with PublicVariables.Foo has made it abundantly clear when I need to later go back and refactor it.
Which method is Mugs?
creating a private UDT with a This as a lone module-level variable
21:49
I'm using that more often now. Very clean.
so instead of g_strDerp = "Hello, world", you go This.Derp = "Hello, world"
right
and frankly the former is unfun to type.
I really hate those special characters. Hard on my pinkies.
The former feels dated, really dated.
An example of bValidatePath doesn't read as clearly as IsValidPath.
I really do think it's symptomatic of what IDE you were working with. If your IDE was essentially a pretty notepad, then you're going to be incentivized into writing acronyms and encoding codes into identifiers to save time (both in coding and in debugging).
The case insensitivity and relabeling all variables with the same name foo->Foo whenever Dim Foo as Bar is declared is one I dislike.
 
1 hour later…
23:01
@IvenBach How many modules/constants in the Excel/Word/Access/PowerPoint/Scripting/Regex/InternetExplorer/HTML/etc. type libraries start with "g_" or "m_". I'll give you a second to calculate the total.... That's right. None.
@IvenBach I had a project where somebody had once declared a variable named recordset and then deleted it, but the identifier remains in the project's memory, so all references to a Recordset type, appeared as recordset. The only way to remedy the casing was to re-create the variable but cased as Recordset, and then delete it again.
@ThunderFrame You got off easy. If there's an object (usually control) on the document module that's crappily named, it wrecks everything and the fix won't work; you'd have to rename that object in the document to fix the VBA.
@ThunderFrame The only time I have no issue with that is Dim value as Foo. I want VBA to have insensitivity like C# does.
@ThunderFrame There's a bit I disagree with. I just read everything in case I miss something that "I've already understood".
Once ran across a project with 500 Access forms and 100 of them had control named ERR or something like that. That made my eye twitch everytime we interact with the Err ERR object.
The section about writing good comments... tear
@IvenBach IIUC, Boolean and Date tests will be made harder because in different locales, eg. French: True = "vrai", and for Date comparisons, the Variant/String date-formats of the user will be parsed to RD, but the Variant/Date date-value will be passed. i.e. you'll need to be careful about converting a date to a string in C#.
23:08
@ThunderFrame all the more reasons to use the variant functions then.
^
The solution is beyond my capabilities.
It's not hard, really.
It made me humbly realize how much I still need to learn.
It's more tedious because you have to write all those import statements.
and do some pointer-slinging to boot (which requires some careful handling)
Where and how do you write them? Is an import statement the same as a using statement?
23:10
this is the same concept as VBA's Declare statement.
mkay
[DllImport("user32.dll")]
public static extern bool EnumChildWindows(IntPtr hwnd, WindowEnumProc func, IntPtr lParam);
@this well, the user has a problem if they write locale-sensitive unit tests, no matter what RD does, those tests will yield unexpected results in a different locale. Might be worthy of an inspection (IIRC, there's already an issue for a general locale inspection), but a unit testing inspection would need to go further and look for assertion comparisons.
@ThunderFrame while i agree that locale specific formats are bad could one really use two different locales implicitly?
I could if I had global collaborators.
23:14
but I'm thinking about the fact that VBA always cast date literals into US dates.
Does it does that even in an non-English install?
If GetChristmasDay(2018) = "25/12/2018" will work on my PC, but not on yours
yeah
At least if we used the variant functions, we would need to pass in locale
which makes it easy for us to flag cases where locales are going to be problematic, like that case above.
@this as an explicit paramter to the Asset methods? That would force users to not only write tests that are locale-aware, but as a result, write code that passes those tests and is thereby locale-aware.
No.
when we deal with expressions and we must call a variant function that requires a locale, we pass in the default locale.
Take VarDateFromStr for example.
if we encounter a literal "25/12/2018", and we know that we need to cast it to a date we will call it.
Since it requires a locale, we will pass in LOCALE_NOUSEROVERRIDE to use the current default locale.
Then we need to flag that we had to handle locale to be later picked up by an inspection. (Maybe annotate the declaration? IDK.)
23:32
best add that to the issue?
which issue?
#TIL
> This was formerly called the Win32 API. The name Windows API more accurately reflects its roots in 16-bit Windows and its support on 64-bit Windows.
23:48
@this didn't somebody open an issue for the tests not yet covered by PermissiveAssetClass?
I did this morning, yeah.
In fact it links to that article.
but the idea I was talking about just now is more about expression evaluation. That's a different problem with much bigger scope.
huh, Error 424 Object Required with statement Left(s, 1) = "a". Same error if I qualify it as VBA.Left(s, 1) = "a". I know Left is a function, but why that error?
are you sure it's not because of s? Left("a", 1) = "a" works.
s="abc":?Left(s, 1) = "a"
True
NVM. I repro'd by removing the ?
well, we get a bit of clue if we change to Left$
Function call on left-hand side of assignment must return Variant or Object
I'm not comparing, I'm trying to assign. I'm expecting an error, just not that error
from help:
> The return type of the function on the left side of the assignment isn't a Variant or Object.
Change the return type. Note that if the return value is an object or a Variant that contains an object, the assignment is to the default property of the object. If the Variant returned isn't an object, the assignment has no effect.
Since Left() returns a Variant, I guess what happens is that VBA tries to assign the "a" to a default property but realize that it's not an object so there's no default property to assign..
23:56
@this I suppose that must be it.
which implies you could abuse stuff like.... GetMyObject() = "a"
which is very hard to comprehend, at point of being nonsense.
because it's really more like GetMyObject().Value = "a"

« first day (1495 days earlier)      last day (1685 days later) »