« first day (1548 days earlier)      last day (1632 days later) » 

12:00 AM
RELOAD!
[rubberduck-vba/Rubberduck] 11 commits. 9 opened issues. 3 closed issues. 49 issue comments. 3400 additions. 1511 deletions.
 
12:13 AM
@Duga that's our Spanish translator!
 
Woot!
 
@erigoni Once all your commits are pushed, you can open a new pull request to get your changes merged into the main repository's 'next' branch - and then poof, Rubberduck habla Español!
 
@MathieuGuindon not quite.... somebody will have to add it to the settings
;)
 
@IvenBach can do that. I sniped him last time.
 
Hola @erigoni :-)
 
12:32 AM
@Vogel612 right
 
> TBH I didn't even know that the WP site had docs, I thought it was just the blog.

Agree that we should consolidate, even to go as far as to say that WP should disappear... IMO there should be an authoritative RD site (rubberduckvba.com) which should host an intro, news, the blog, user instructions, a quick and direct link to the latest green release (not a link to GH, go find it yourself), and links to the GH repo and wiki (for contribution docs).

Ideally, with well-known and reliable do
> TBH I didn't even know that the WP site had docs, I thought it was just the blog.

Agree that we should consolidate, even to go as far as to say that WP should disappear... IMO there should be an authoritative RD site (rubberduckvba.com) which should host an intro, news, the blog, user instructions, a quick and direct link to the latest green release (not a link to GH, go find it yourself), and links to the GH repo and wiki (for technical and contribution docs).

Ideally, with well-known a
 
@MathieuGuindon I see the problem in KeyPressEventArgs. I didn't realize you were handling WM_CHAR too.
WM_CHAR doesn't give a VKEY, so you can't cast it to Forms.Keys.
 
12:55 AM
I'm wondering if we should have a new tag ([parity]?) which would indicate that a particular feature is needed to reach feature-parity with an existing VBE feature. I'm currently (mildly?) obsessed with Code Explorer, looking to get to the point where users feel no need to keep PE open as CE does everything it does but better.
#AmINuts?
 
@Comintern huh, but I thought I was handling that..
        if (character == default(char))
        {
            Key = (Keys)wParam;
            if ((User32.GetKeyState(VirtualKeyStates.VK_CONTROL) & 0x8000) != 0)
            {
                Key |= Keys.Control;
            }
        }
        else
        {
            IsCharacter = true;
        }
obviously that's not working though
 
I think I may have mis-read that.
Which is the key that is getting ghosted?
 
m / {enter}
 
It's also possible that the cast to char is the issue.
 
1:02 AM
If we don't need any of the non Keys information, it should probably just go through VkKeyScanExA and then cast to Keys.
^ That's the locale aware conversion.
 
Actually I think we want the wide version.
Should probably use the Keys explicitly as flags too - can't they have multiple modifiers set?
 
@MathieuGuindon do you have time / inclination to port Battleships to VB6? If not, do you mind if I do so when the source is posted? Would love for it to be a showcase for #4099 - it could be the first ever project on GH to implement CI with unit tests, courtesy of RD...
 
1:17 AM
@mansellan I was planning to create a repo for it under \rubberduck-vba\battleship ;-)
 
so... you wanna port it or should I?
 
I think it's already ported ;-)
you just don't use a WorksheetView
 
:-)
 
...or a UserFormView
 
MDIForm ? :-)
 
1:19 AM
yeah why not
or a console
 
yeah.... VbForums has lots of howtos on how to do VB6 console apps. It's crying out for some RD!
RD - making VB[A|6] what it should have been by now.
 
the VBE anyway :)
 
/sidenote - GH needs more VBA and more VB6...
 
> AIUI (and @retailcoder can correct me), the RD site isn't exactly the easiest thing to manage, which is why WP site has gotten more updates. RD site isn't a LAMP which kind of hinders the idea of installing Wordpress on it. (It can be on Windows but do you really want to run Wordpress on Windows?!? Huh uh. Didn't think so...)

One thing bears calling out is that the GH's wiki can be used like a 2nd repo and thus can be used via the git workflow. Some one solved the problem of transferring t
 
@mansellan I put do a VB6 ncurses port for it if you really want...
 
1:30 AM
@Comintern why stop there? Include recurse, too.
 
Maybe I'll just curse.
Should this have backspace in it?
        case WM.CHAR:
            var c = (char) wParam;
            if (c != '\r' && c != '\n' && c != '\t')
            {
                args = new KeyPressEventArgs(hWnd, wParam, lParam, true);
                OnKeyDown(args);
                if (args.Handled) { return 0; }
            }
            break;
 
googles ncurses ahh... a linux thing. yeah, I should probably grok that sometime...
;-)
 
@Comintern backspace doesn't give us a WM_CHAR though
 
@mansellan Pretty sure it's not Windows only.
 
@Comintern I would very much prefer to not have any backspaces in me, thank you very much.
 
1:32 AM
@MathieuGuindon Hmmm... I could have sworn it did.
 
#grokfail
#embarrassed
#googling
 
Does ctrl-H backspace?
That's what the WM_KEYDOWN would be if it were cast to char
 
pretty sure that's a console thing.
 
fml
> my god, it's full of messages
 
lol
VBE catches ctrl-h first.
 
1:34 AM
so it is ctrl-h even in non-console context? #TIL
 
OK, F6 and see if that sorts it.
Do we care if this is case insensitive?
 
I think not
 
Ok
 
@MathieuGuindon It's for the Office team, several positions, although the one he pointed me at was for Outlook.
I have a call at 6PM my time with him next Tuesday.
(Monday is a national holiday.)
So, long weekend, then a chat Tuesday, and maybe a formal interview on the 13th.
 
1:50 AM
gool duck, @Hosch250!
7
 
Thanks.
 
@Hosch250 wow, what @this said!
 
2:22 AM
Alright, it's a bit trickier. If RD doesn't handle the WM_KEYDOWN, the VBE is calling TranslateMessage. That's what generates the WM_CHAR message that follows. So, when we do this:
    Key = (Keys)wParam;
    if ((User32.GetKeyState(VirtualKeyStates.VK_CONTROL) & 0x8000) != 0)
    {
        Key |= Keys.Control;
    }
RD is processing the same keystroke twice.
m | ctrl is 0x0D, which is [Enter].
Is the only think we care about in the keydown [Ctrl]?
 
2:49 AM
> Love the idea of using xml docs to drive site MD (duck check: is this SandCastle for 2018?). But how does this solve for blogging?
 
3:19 AM
I guess it would be idiomatic, yeah. IMO default members are a language trap though: code isn't just written to be executed; it's mostly written to be read, and default members abstracts away the syntax rather than the idea. This can easily makes the reader miss what's going on... the code says one thing, and does another behind your back -- unless you know the API and you're familiar with it now.. If only there was a VBIDE add-in that could warn you about implicit member access! A good chunk of VBA questions on SO are asked because of them, and solved with explicit member access ;-) — Mathieu Guindon 17 secs ago
 
> I guess on this thread of blog thought/conversation we could consider blogging containing modular behaviour in yaml files put together (built as depend after successfully done XML-doc) by sections of generated HTML of content interest. For examples/ideas...
https://help.github.com/articles/using-jekyll-as-a-static-site-generator-with-github-pages/
I have followed someone’s setup to make my test webpage ending with *.GitHub.io I’m considering blogging soon.
> I guess on this thread of blog thought/conversation we could consider blogging containing modular behaviour in yaml Jekyll behaviour works with yaml files put together (built as depend after successfully done XML-doc) by sections of generated HTML of content interest. For examples/ideas...
https://help.github.com/articles/using-jekyll-as-a-static-site-generator-with-github-pages/
I have followed someone’s setup to make my test webpage ending with *.GitHub.io I’m considering blogging soon.
 
@Duga uhm... ima just sayit. R U a markov???
@PeterMTaylor R U real, or is this some kinda research ting?
'cause if not, uh, you're sounding like a bot...
 
3:43 AM
> Um, yeah, Thanks for that, Anything else?
 
ohai @PeterMTaylor! RU human?
 
I am very much a human being aware of its own flaws. :)
 
your comments are very odd. care to comment?
^^
 
its the question of asking me that I am human.
 
that's a very markov thing to say. what is the average flight speed of an unladen swallow?
...
df?
 
3:51 AM
Anyhow petermtaylor.github.io this is one example of my website using ya l files put together
 
uh, yeah, thanks for that, MODS!!!!
@MathieuGuindon do you know @PeterMTaylor? Almost certainly a bot, kick.
 
@mansellan ?
 
uh ? Am I rude?
 
Is PT real?
 
he's been around since (almost) the beginning, watching our progress and encouraging RD!
 
3:54 AM
eek
 
Yes its my real name
 
language fail on my part then - sinccere apologies.... you sounded like a markov chain, but that's my fail!
cannot apologise enough...
 
Often my thoughts and written words aren’t clear at times I’m sure others often find its the case but I improve myself when I can...
 
@PeterMTaylor I apologise, I had trouble interpreting your posts, but that's on me. Please forgive me.
 
Forgiven mate :) perhaps suggest which parts of my post would make more sense so I could clarify.
 
4:08 AM
no, sorry - just an instinct - I write bots and chains at work, but I appreciate that language gaps can emulate AI. Like I say, my bad.
 
jesus, actual, christ. I put together an email, and it turned up in SE. Why? I'm about to give up.
Oh, and just for giggles, I can't delete it. Thanks, internet.
you know what, I'll get my coat.
bye.
 
4:54 AM
Are any of us real? Solipsism be damned.
@mansellan Peter M Taylor is very much real. He's from a future where pucntuation is superfluous.
Me, I'm from a future where spelling is superfluous.
 
5:22 AM
@ThunderFrame :)
 
5:56 AM
@Duga oh, wow
 
0
Q: Battleship UI: GameSheet

Mathieu GuindonIn the previous post I presented the MVC architecture, but all we saw of the View was the pretty bits. From the outside everything looks innocently pretty: The guts of the worksheet's code-behind is a bit more... chaotic. Maybe not chaotic-evil, but chaotic nonetheless, despite the fact that i...

 
Is there any difference performance wise between
Public Sub Foo()
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet1")
With ws
Debug.Print .Cells(1, 1).Address
Debug.Print .Parent.Name
End With
End Sub

Public Sub Bar()
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet1")
Debug.Print ws.Cells(1, 1).Address
Debug.Print ws.Parent.Name
End Sub
I.e. use . within a With versus repeating the variable ws?
I didn't think so
But wanted to ask
I prefer With notation aesthetically
 
6:12 AM
With blocks hold an object reference, but the dereferencing happens with the dot operator, which needs to be there for every member call anyway - so in this case it's the equivalent. However without ws there'd technically be a micro-perf difference, since you wouldn't be holding on to the reference anymore, i.e. repeatedly fetching the sheet from ThisWorkbook.Worksheets vs using a local variable; if the sheet exists at compile time IMO it's best to use With {codename} though ;-)
TTGTB
 
Sorry just digesting and now googling
"TTGTB" on intermittent internet connection.
Gah!
ah. Night. Thanks.
With codename .... I rarely see that being used. Interesting.
 
6:28 AM
@QHarr Use a meaningful codename, like settings instead of Sheet1, and then your code is resilient to users changing the name and/or position of the sheet.
 
@ThunderFrame Thanks. Ah... I'm still digesting Matt's last point.
With . notation there is de-referencing and then "something" has to go back out to the worksheets collection to collection the sheet referenced in the With?
something = compiler?
 
@QHarr With settings 'settings is the codename of the settings sheet
 
I understand that. I meant penultimate point. Sorry.
"However without ws there'd technically be a micro-perf difference, since you wouldn't be holding on to the reference anymore, i.e. repeatedly fetching the sheet from ThisWorkbook.Worksheets vs using a local variable"
 
@QHarr it's all about minimizing the objects that need to be "processed" by the vbruntime. If you use ThisProject.ThisWorkbook.Sheets(1).Cells(1,1).Value, then the runtime has to find your value by going via ThisProject.ThisWorkbook.Sheets(1) every time, whereas, settings.Cells(1,1).Value is more direct.
 
Ok. And if I have a local variable like ws (worksheet) and use a With statement i.e. With ws, that has to go back out to the worksheets collection each time . notation is used within?
Oh...oops...
So is settings.Cells(1,1).Value more direct than ws.Cells(1,1) ?
Sorry....I know I can be slow on the pick-up.
 
6:39 AM
@QHarr no, once you have a worksheet reference (and the worksheet codename gives you one for free), and you're working with its members, you never need to know about the worksheets collection.
@QHarr It depends™.
 
The classic IT answer.
:-)
I'm still chewing on the line: "However without ws there'd technically be a micro-perf difference, since you wouldn't be holding on to the reference anymore, i.e. repeatedly fetching the sheet from ThisWorkbook.Worksheets vs using a local variable"
So a With ws statement using . operator inside
Is that having to go to worksheet collection due to de-referencing?
 
ws.Cells(1,1) is calling the default member which is _Default which, behind the scenes, is normally calling ws.Cells(1,1).Value. Most of the time (99.99% of the time), you probably want ws.Cells(1,1).Value2
 
@ThunderFrame Understood.
 
@QHarr NO, NO, NO. Once you have a reference, you have a reference. the ws doesn't know or care that is part of a collection
 
Which makes sense. So what am I failing to understand in Matt's sentence? :-(
Not sure that is an easy question to answer btw!
 
6:44 AM
the compiler only knows that ws is a Worksheet, and that any and all . members are merely members of that type.
 
k
 
@QHarr I'm not sure I understand your question
 
When Matt refers to "repeatedly fetching the sheet from ThisWorkbook.Worksheets"
 
ws.foo is equivalent to With ws: .foo: End With
 
Ok fine.
That all makes sense. So the de-referencing doesn't go to worksheets collection, it just decouples and recouples (made up!) with the object reference held in the With ws.
 
6:48 AM
@QHarr Imagine you're in a Library, and I tell you to go find a book: Library.Building(6).Floor(3).Aisle(7).Shelf(4).Book(4). And now imagine I tell you to go and get Library.Building(6).Floor(3).Aisle(7).Shelf(4).Book(5) and then Library.Building(6).Floor(3).Aisle(7).Shelf(4).Book(6)
 
k
 
that's a lot of going back to the start each time
 
yup
 
now, imagine I tell you: Dim myShelf As Shelf: Set Shelf = Library.Building(6).Floor(3).Aisle(7).Shelf(4)
 
k
 
6:51 AM
now, I ask you for myShelf.Book(4), myShelf.Book(5), and myShelf.Book(6) - You don't need to go back to the start each time, you just magically goto ``myShelf` and pull a book
 
indeed
 
same applies to With myShelf : Debug.Print .Book(4), .Book(5), .Book(6): End With
 
Aha...
💡
Thank you very much
That is what I initially assumed.
 
the reference is like a wormhole from the front door of the library to the specific shelf... You just need to Set the path once, and the reference will always give you the shortcut.
 
I think of With as a context manager
 
6:58 AM
With should be thought of as being exactly equivalent to:
 
Thanks to you both for your time
 
Dim myTemporaryVariableOfTypeReturnedByTheAssignment
Set myTemporaryVariableOfTypeReturnedByTheAssignment = myWorksheet 'myTemporaryVariableOfTypeReturnedByTheAssignment is now a Worksheet
'Do things with members of myTemporaryVariableOfTypeReturnedByTheAssignment
Set myTemporaryVariableOfTypeReturnedByTheAssignment = Nothing
FreeTheMemoryUsedBy myTemporaryVariableOfTypeReturnedByTheAssignment 'FreeTheMemoryUsedBy is a hidden VBA operation, the name of which I have just made up
that is, A With block does two things. It creates an invisible variable that (unlike any other variable) only exists until the End With statement is executed, and it allows the . notation without explicitly requiring the reference variable to be placed before it.
 
Thank you
 
in extreme scenarios, a With block frees the memory when it hits the End With statement, as opposed to the end of the scope in which the variable is defined (which might be outside of the current procedure). Freeing that memory as early as possible, might be beneficial, in certain situations.
but most people just use With blocks, because it reduces typing.
 
 
6 hours later…
12:49 PM
in The 2nd Monitor, 7 hours ago, by Captain Obvious
0
Q: Battleship UI: GameSheet

Mathieu GuindonIn the previous post I presented the MVC architecture, but all we saw of the View was the pretty bits. From the outside everything looks innocently pretty: The guts of the worksheet's code-behind is a bit more... chaotic. Maybe not chaotic-evil, but chaotic nonetheless, despite the fact that i...

Is there anything you can't do in VBA, @MathieuGuindon?
I'm just shaking my head...
 
1:07 PM
@SimonForsberg shaking of the head would be a "No" then? Let's set @MathieuGuindon a real challenge, and get him to reproduce the Diamond Problem in VBA.... Now that would be a feat.
 
isn't that actually impossible?
can't inherit from implemented interfaces, right?
 
Yep, it is impossible: VBA does not support implentation inheritance and all interface implementations have to specify the interface explitly. Moreover, you cannot extend interfaces in VBA.
 
2:18 PM
I think that was the joke - for him to do it would be hard.
 
2:37 PM
@Comintern sniper who?
d
 
@IvenBach Referring to adding the Czech translation to settings. ;-)
 
@this yep, There's a limit to how much OOP @MathieuGuindon can squeeze out of VBA.
 
Now I grok. Time for some roofing. Gravity will not get the best of me.
 
@IvenBach groking and roofing do not belong in the same sentence. If you're groking and roofing, I'm guessing gravity will get the better of you.
 
I've found groking gravity is a much better strategy for staying on the roof.
 
2:52 PM
@IvenBach Maybe consider a harness?
Then it can't get best of you
@ThunderFrame Well, if he writes enough boilerplate code, it could be done. Look at Joel's Wasabi. Of course Jeff had some thoughts about it.
 
@this yeah, I suppose I ought to add the condition that a class can't have an Inherits member, or some such tomfoolery.
reminds self, that CR VBA StringBuilder question needs a review.
 
3:09 PM
@ThunderFrame Easy. Write a VBExtender C(whatever) library. Reference it, then hey, VBA now supports interface implementation!
 
3:20 PM
@this inject an AvalonEdit window with support for C++ and hey presto, Diamond Problem in the VBE.
 
Microsoft, this dialog is screaming, "WE WUZ TOO LAZ TO FIX IT"
and you thought you're so clever, deleting all the auto-recovered files, don't you?
 
3:37 PM
@this I harness the power of “hold my beer” to prove I don’t need a harness.
Think before acting and that avoids most of problems.
 
@IvenBach so, by the power of beerskull, then?
 
4:13 PM
@SimonForsberg reading that 'you' as an impersonal pronoun makes me want to reply 'nope, and I'll blog about it until every programmer knows VBA is OOP and as much of a "real language" as any other!' ...reading 'you' as referring to me I'd say yeah.. refactoring that damn controller to support different game modes!
Still, thanks!
 
@MathieuGuindon yeah, I was referring to me, or you, or... whatever.
 
:+1:
"A" in BASIC stands for 'all-purpose' =)
 
4:28 PM
Version 2 will allow division by zero, prove the Grand Riemann hypothesis, while demonstrating that P = NP and emitting a steady stream of Higgs Bosons from cell A1.
 
@Comintern HHCIB?
 
IKR?
 
4:46 PM
> Something we could toss around is the idea of using GH-Pages to segregate external documentation from internal documentation. That way the internals can be documented in the wiki and the user docs can go to rubberduck-vba.github.io/docs
Added PSET, SCALE and CIRCLE tokens to the statementKeyword parser rule

These were forgotten to add there when the tokens were introduced.
Adapted tests for circleSpecialForm to not test the most evil version

The most evil version is extremely hard to parse with a context free parser.
[rubberduck-vba/Rubberduck] MDoerner pushed commit 33de5fc1 to next: Reverted circleSpecialForm parser rule change and ordering in mainBlockStmt
[rubberduck-vba/Rubberduck] MDoerner pushed commit b4e967ba to next: Merge branch 'next' into GrammarKeywordFix
Merge pull request #4332 from MDoerner/GrammarKeywordFix

Grammar keyword fix
 
@this :+1:
 
> > But how does this solve for blogging?

It doesn't - as mentioned it's mainly useful for internal developer's documentation. User documentation likely needs to be maintained separately anyway since the categorization will be quite different when looking at the ducky as a user vs. as a developer.

If we can have both user documentation and blogging maintained by same software, that would be a win in the maintainability. Whether there's a software that supports all features typically neede
 
Roofing is like software. Don’t be cheap and put a facade over the old shit to save time and money. It’ll end up costing you. #ThanksGrandma...
 
5:14 PM
@Comintern LOL!
 
5:40 PM
I'm surprised AI vs AI actually plays to completion: every move deepens the call stack, I need to fix that with a proper game loop...
 
5:59 PM
@rubberduckvba I can provide translation in Bulgarian ☺
4
 
[rubberduck-vba/Rubberduck] build for commit b0d47104 on unknown branch: AppVeyor build succeeded
 
6:33 PM
> Sorry this stayed in WIP status for so long. Introducing the LetCoerce class (a good thing I think) resulted in a significant re-evaluation of how errors/invalid tokens were handled. The result was an approach that supports parsing operations to throw exceptions rather than hiding them all behind the 'TryParse' type functions. Somewhat unexpected, the changes allowed the inspection to now flag compilable runtime errors (Mismatch and Overflow) that are lurking within the code (within Selec
 
 
4 hours later…
10:31 PM
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4127?src=pr&el=h1) Report
> Merging [#4127](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4127?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/6969d727da85939844f9168c0da5ceafd28f9f09?src=pr&el=desc) will **increase** coverage by `0.98%`.
> The diff coverage is `92.03%`.


```diff
@@ Coverage Diff @@
## next #4127 +/- ##
=======================
[rubberduck-vba/Rubberduck] build for commit b0d47104 on unknown branch: 53.91% (target 0%)
 
11:11 PM
#Freebies Battleship bugs found in the CR posts: 1) AI vs AI deepens call stack at every turn (fixed now); 2) controller somehow assumes player1 is the human (on it); 3) extending RandomAI to destroy acquired targets after it found all enemy ships, enters infinite loop if there are gaps in an area (fixed now)
 
@MathieuGuindon I've hit that a few times now in different projects :)
@MathieuGuindon You've got a Spanish offer too :)
 
11:26 PM
@Hosch250 the fix I did is pretty simple: just explicitly handle AI vs AI scenario
Perhaps a bit naive, but AI being imperative and human being event-driven makes it hard to have one logic to handle all scenarios
 

« first day (1548 days earlier)      last day (1632 days later) »