« first day (1489 days earlier)      last day (1691 days later) » 

12:00 AM
RELOAD!
[rubberduck-vba/Rubberduck] 2 commits. 2 opened issues. 1 closed issue. 1 issue comment. 76 additions. 2 deletions.
 
12:14 AM
Home time. Enjoy the weekend pond.
 
 
4 hours later…
4:23 AM
This is about VBScript, but looks to be pretty useful for analysing p-code and the VM interpreter - I haven't fully read it yet, or played with the GitHub repo, but I'm confident there'll be stuff of use to RD - Delving deep into VBScript
 
4:37 AM
> The CScriptRuntime class contains all information about the state of the interpreter: local variables, function arguments, pointers to the top of the stack and the current instruction, plus the address of the compiled script.
> Microsoft engineer reports dated 1999 and 2004 that shed some light on the p-code. There was enough information there for me to fully reverse-engineer all the VM instructions and write a disassembler!
 
hey @ThunderFrame. Whilst interesting, I can however confirm that VBScript bytecode is very different to VBA/VB6 execode.
 
@WaynePhillipsEA sure, but the p-code is similar?
 
nope. the 'pcode' they are referring to in VBScript is most similar to VBA/VB6 execode. In VBScript you've got circa 100 opcodes. In VBA/VB6 you've got circa 1000 opcodes.
Vaguely similar, but actually very different.
 
Presumably because of the strong typing?
 
exactly.
pity the fool that worked all 1000 of them out. oh wait, that was me :)
 
4:52 AM
@WaynePhillipsEA haha. I remember reading somewhere that there's nobody left at MS who knows how it actually works. When their engineers do need to touch VBA, they rely on the APIs, and binary serialisation takes care of itself.
 
Well I guess someone there still has their hands in the compiler, relatively recently at least, due to the big 64-bit upgrade.
FWIW 64-bit execode format is completely different to the 32-bit counterpart
 
@WaynePhillipsEA I know, but even recent additions haven't been implemented as cleanly as earlier ones. Some new keywords aren't as robustly restricted in terms of how they can be used. I forget a specific example right now.
 
It is of course very similar in operation, but the format is completely different. As if it was re-written from scratch.
 
@WaynePhillipsEA that's Microsoft's standard approach to enhancements... Rewrite.
Internet Explorer, Skype, etc
 
very true
 
5:01 AM
Or maybe they "obfuscated" the approach with 64-bit, in order to put that clever chap from Everything Access off the scent. ;-)
 
haha well, I already parse the 64-bit opcodes in vbWatchdog for something, so I guess if that were the case, they failed ;)
g2g busy day ahead. catch you later @ThunderFrame
 
Night morning
 
 
5 hours later…
9:52 AM
Bah. Went to release my Rx project to live this morning, but it failed and had to be rolled back. Fml.
 
> This it how it looks now for more than 30 minutes:

![grafik](https://user-images.githubusercontent.com/40824720/42269989-081208b2-7f80-11e8-8296-208163540770.png)

And it slows the VBE massively down.

I have a new installation and a ~50 forms + 100 modules project.

The memory consumtion is also very high. Before rubberduck, the process needed ~50mb Ram. Now it is beteen 500 and 800 Mb.
 
10:17 AM
> What version do you have installed? Could you please try pasting the Logs (preferrably at Trace-Level) to help us nail down the issue? Thanks!
 
10:49 AM
> I use:

Version 2.2.0.3468
OS: Microsoft Windows NT 10.0.16299.0, x64
Host Product: Microsoft Office 2016 x86
Host Version: 16.0.4666.1000
Host Executable: MSACCESS.EXE

I restarted access and restarted my code inspection again:

This is the log after ~5 minutes:
[RubberduckLog.txt](https://github.com/rubberduck-vba/Rubberduck/files/2162920/RubberduckLog.txt)
> I use:

Version 2.2.0.3468
OS: Microsoft Windows NT 10.0.16299.0, x64
Host Product: Microsoft Office 2016 x86
Host Version: 16.0.4666.1000
Host Executable: MSACCESS.EXE

I restarted access and restarted my code inspection again:

This is the log after ~5 minutes (the memory consumtion is ~ 600 mb):
[RubberduckLog.txt](https://github.com/rubberduck-vba/Rubberduck/files/2162920/RubberduckLog.txt)
 
11:01 AM
> This is the log after ~15 minutes (Memory is still ~600 mb):

[RubberduckLog after 15 minutes.txt](https://github.com/rubberduck-vba/Rubberduck/files/2162964/RubberduckLog.after.15.minutes.txt)
> ok...now it seems to have finished (after ~25 minutes) after restarting.

Here is the Log:

[RubberduckLog.txt](https://github.com/rubberduck-vba/Rubberduck/files/2162984/RubberduckLog.txt)
 
11:38 AM
I've updated RD today (from a build a few weeks old to 2.2.0.3468-pre) and now on every launch, RD notifies me that Rubberduck version 2.2.6672.23088 is now available! Would you like to review the release notes now? [Yes/No]
 
Come on VBA, why was TypeOf specified to return an error 91 if the variable holds the value Nothing?
 
Is this behavior normal/expected?
 
Oh
The version number the check gets from the website is wrong; it is based on the wrong logic fixed some prereleases ago.
Unfortunately, that bug was on the release version.
 
And the website is tied to the latest stable release?
 
Could you please open an issue for this?
 
11:43 AM
Sure
 
I am not sure whether it is the latest stable release or the stable release with the highest version number.
The latter would be a problem.
The check will be broken anyway for the next release since the current version is too high.
Hm, unless we release 2.3.
 
Shouldn't it only notify about newer versions available?
 
On the dev side we do not see the check because it is disabled on debug builds for obvious reasons.
 
I see. I sometimes encounter similar issues in my work projects. ;)
 
The check whether it is newer is based on the version.
Unfortunately, the version had been derived from the wrong assembly in the last release.
That version is way higher than intended.
 
11:50 AM
> okay let's get some overview out of the final log:

```
12:44:25.2802 Rubberduck starts parsing
12:44:27.4863 Loading References
12:44:44.6311 Parsing Complete
12:44:45.6793 Start Resolving Declarations
12:44:47.6825 Declarations are Resolved
12:44:49.7591 Start Resolving References
12:45:29.1239 Rubberduck Reports "Ready" status
// Parsing run finished after 65,3371173s;
```

Then there's another two parse passes, the first taking 5 seconds and the second taking 8 seconds actuall
> Likely related to [issue 4052](https://github.com/rubberduck-vba/Rubberduck/issues/4052).

I've updated RD today (from a build a few weeks old to **2.2.0.3468-pre**) and now on every launch, RD notifies me that

> Rubberduck version 2.2.6672.23088 is now available! Would you like to review the release notes now? [Yes/No]

This doesn't seem like the intended behavior. As such, @MDoerner asked me to open this issue.
 
welp ... 20 minutes inspection time for 307 results is ... a bit broken ...
We should log some basic metrics about the number and size of modules analyzed...
 
> According to the log, the culprit is the ObjectVariableNotSetInspection ...
> According to the log, the culprit is the ObjectVariableNotSetInspection ...

The code for that inspection iterates over the references between different User modules and thus it's runtime in the worst case is exponential in the number of user modules. That is ... not ideal.
> According to the log, the culprit is the ObjectVariableNotSetInspection ...

The [code for that inspection](https://github.com/rubberduck-vba/Rubberduck/blob/next/Rubberduck.CodeAnalysis/Inspections/Concrete/ObjectVariableNotSetInspection.cs) iterates over the references between different User modules and thus it's runtime in the worst case is exponential in the number of user modules. That is ... not ideal.
 
12:07 PM
there's 4.2k resolver failures in that log ...
 
12:18 PM
@M.Doerner Because Nothing is not strong-typed.
 
obtw: the Resolver logs codesnippets... we should be upfront about that, because corporate overlords might try to sue our backsides off, when they notice
 
@this But it is supposed to return whether the value is compatible with the specified type, which is true for Nothing for all object types.
Ok, in a sense it is also not compatible with anything because member calls will fail.
 
But if you had a If block or Select Case True block and branches depends on the TypeOf xxx Is yyy, a Nothing would always come up as true and thus fall through to the first branch, making all other branches unreachable under that condition.
 
> My bad. I never updated the website build with 2.2.0, so it's an old debug build up there. There's no bug, just the version-comparison logic falls apart if a non-release build is deployed to the website. I just need to overwrite the file with the actual 2.2.0 build and it'll fix itself. I can do that tonight.
 
12:32 PM
Error 91 prevents that from happening, it seems to me. Better to error out than give out nonsense answers.
 
> The ParseCoordinator logs times in seconds, everywhere else, times are logged in milliseconds. This should be unified.

Considering that inspections and single-module parsing / resolving is in the low milliseconds it makes sense to unify to that.
 
1:29 PM
@MathieuGuindon Is it really because of an old debug build? The current release version has the version number bug.
 
> The parser is meant to support scenarios where we need to work with code that are still up in the air. The parser is totally disconnected from the main parser and takes in a `string` that only needs to represent a minimally valid code module body and builds a valid parse tree.

This can be used for example, in code preview, so that rewriting can be handled using the rewriter API for example.
 
@Duga @MathieuGuindon here you go.
 
@M.Doerner if I put 2.2.0 on the website, any 2.2.x won't trigger the notification
@this awesome!
 
> This is great. I wonder if we could (for simplification purposes) default to LL prediction. That could simplify this even further
 
@Duga If Mat ends up using it in AC, he's going to want the speed of SLL. OTOH, the try won't help. Maybe support overloaded constructor so that by default we try SLL then LL (just like the normal parser), but if explicitly specified, we can skip the try and just parse in that mode. However, the parser will throw an error in all cases, so the calling code has to have a try block while constructing the parser.
 
1:47 PM
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4153?src=pr&el=h1) Report
> Merging [#4153](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4153?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/debf4a6bc809b79fa70428de598b6913b068905d?src=pr&el=desc) will **increase** coverage by `0.02%`.
> The diff coverage is `70.97%`.


```diff
@@ Coverage Diff @@
## next #4153 +/- ##
=======================
[rubberduck-vba/Rubberduck] build for commit af66193a on unknown branch: 52.46% (target 0%)
[rubberduck-vba/Rubberduck] build for commit af66193a on unknown branch: AppVeyor build succeeded
 
 
1 hour later…
2:52 PM
> * I opened my project
* Navigate to a codefile (a Form). It does not matter if I use the Rubberducks modul-explorer or the built in one
* uncomment a line
* write "Call ZFormHelper." => the autocompete list opens
* choose "Bildobjekt" as a function
* tried to write "(" to continue => access crashes

This is the log:
[RubberduckLog Crash.txt](https://github.com/rubberduck-vba/Rubberduck/files/2163621/RubberduckLog.Crash.txt)

I restarted access several times but I crashed every time I
> Linking #4141

There's a bug in the autocompletion (exact repro steps still not confirmed though) that makes inline completion crash the process (unhandled off-by-one error, most likely).

You can disable `(`, `{`, `[` and `"` autocompletion to remove the possibility for this bug to happen.
 
3:11 PM
 
3:53 PM
Happy July 4th to stateside ducks
 
4:04 PM
0
Q: Excel: store account numbers as text

Patrick HonorezI wrote the below code to make sure account numbers (accounting), which are numbers, are strored as text in the range. Replacing r.value by r.text does not seem to work on whole ranges, so I need to loop. Any better idea ? Sub num2text(r As Range, Optional keepFormat As Boolean) 'change numbers ...

 
Is there any way in VBA to test for an object type dynamically?
I mean, without hardcoding the type.
 
@M.Doerner beyond TypeName and TypeOf ... Is ... ...not that I know of
 
4:32 PM
For TypeOf... Is... you have to hard code the type as far as I know.
TypeName on the other hand does not have the hard coding problem, but it does not help with types that need to be qualified.
For my current application I really only need built in types. So I will probably just leave it at using VarType.
 
4:59 PM
> Could could I make a polite request to increase the text size in the code explorer window as its rather small for my aged eyes.

In the longer term could we have a setting so this is user configurable in panes that RubberDuck provides.
> Tagging with difficulty 01 because no prior knowledge of how Rubberduck internals work is needed for implementing this - however it does require some experience with WPF and styling: we need these font sizes / styles in a centralized place, so that the UI can be consistent across the board.
 
@M.Doerner an option is to maintain a standard code module that is auto-regenerated. That's what I do when I need to enumerate a subset of private types or maintain an enum to some external resource (e.g. a table)
 
> In the use case the parser was originally developed for, I had no need to support the preprocessor directives. That said, anyone else is welcome to enhance it to handle those other cases.
 
 
1 hour later…
6:42 PM
> The last commit allows for explicit mode which also reduces the overhead as when we explicitly specify a mode, there is a one less try block. The calling code, however, still needs to have a try/catch block to handle any exceptions returned by the ANTLR parser. It retains the default behavior of mirroring the main parser, trying w/ SLL then fallbacking to LL mode. When the mode is explicitly specified, there is no fallback at all. That may or may not offer some performance improvements for
 
@this congrats for the MVP renewal btw - 10 years!
(right? I'm looking at the right profile?)
 
Yep
Thanks!
 
[rubberduck-vba/Rubberduck] build for commit e7197bd7 on unknown branch: AppVeyor build succeeded
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4153?src=pr&el=h1) Report
> Merging [#4153](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/4153?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/debf4a6bc809b79fa70428de598b6913b068905d?src=pr&el=desc) will **increase** coverage by `0.04%`.
> The diff coverage is `85.71%`.


```diff
@@ Coverage Diff @@
## next #4153 +/- ##
=======================
 
saw this?
48
Q: Is a Microsoft MVP required to disclose affiliation?

CÅ“urMicrosoft (124,000 active employees worldwide) has a system for rewarding non-employees, the "Most Valuable Professional". With apparently 3,024 active MVP worldwide, that's very few people compared to how many devs Microsoft loves. I'd like to know if MVP people, who are kind of non-employees ...

 
[rubberduck-vba/Rubberduck] build for commit e7197bd7 on unknown branch: 52.48% (target 0%)
 
6:57 PM
no didn't - reading
 
7:50 PM
@this does Access' OM have a _Global module?
 
not sure what is included in that.
there's the VBA.Global and Globals but I don't think that's the same thing.
 
right. just trying to explain how unqualified Range works in Excel and fails in Access, even with a reference to the Excel type lib
 
that's not something to do w/ global
 
Excel._Global and Excel.Global appear to be the same thing
 
that's something to do w MIDL attribute appobject
 
7:59 PM
so Range("A1") is a call to Application.Range?
 
that's what I thought it was
 
hmm
then how come some errors involving such unqualified member calls throw up a message involving "Method Global.Range failed"?
 
I didn't realize there was a Excel.Global that has similar properties as Excel.Application
That's a good question, TBH.
 
just checked, Word.Global exists too
 
I also found that Sheet1 don't work in Access VBA project
it can be only loaded by Excel, more or less.
 
8:19 PM
In the specific case of Access VBA project. It has to reference members of Excel.Application. Seems to me that the Range is not a member of the Application object
 
it is though
 
hmmm must be looking at it wrong didnt aee it on madn list
 
so _Global (Global?) might just be an interface Application implements, a bit like WorksheetFunction
 
To be certain need to look ar IDL
 
competing with Max for 2018 typo championship? ;-)
 
8:22 PM
Before i left i did verify its not convertible to application.
Phone is bad for typing
 
Oleview or olewoo may help answer
 
I think I'll put it up on SO
 
Where do sheet1 class go? In global too?
 
Sheet1 would be a member of VBAProject
I think
yup - IntelliSense shows it under VBAProject
 
8:24 PM
Yeah thatd be how it works in Access for its forms reports.
 
the madness is consistent, see
:)
 
Flummoxed abt why they jave globals. Pls paste a so link. Id love to follow
At least they are consistent in that.
G2g. L8r
 
l8r m8
gosh never let me type that again lol
 
9:25 PM
@MathieuGuindon The reason Range fails is because the instance of Excel that is implicitly created, is started without any workbooks open, so the Range call fails with exactly the same error as if you try it in Excel without any workbooks open. But try an Excel global like Workbooks from Access, and it does work: wbkCount = Workbooks.Count
You also end up with a hidden copy of Excel as a result of the global call.
 
Gah, makes complete sense!!
 
see github.com/rubberduck-vba/Rubberduck/issues/2469 and the link to MSDN that explains.
 
So would the goal of RD is to minimise global calls to prevent hidden processes in the background?
 
^ found by googling "globals vba implicitly created" and the RD github issue is in the top 3 results.
@PeterMTaylor it depends. For calls that involve the creation of an App like Excel, probably yes, but accessing a constant, or creating an object that doesn't involve an App creation, probably not
 
@ThunderFrame haha that's awesome!
 
9:42 PM
A paradox when you say it like that @ThunderFrame.
 
@PeterMTaylor eg. Scripting Runtime has Global variables, but even if it had some global classes/methods, it wouldn't really be creating an application like the Excel calls are. It's probably still better practice to be explicit though, and probably faster too.
 
10:07 PM
^ Global variables constants
@MathieuGuindon Some of your <pre> code blocks on the blog don't have any indentation. I know a tool that can help with that...
 
10:57 PM
> Currently, the organization of the parser is kind of a mess. Too many things are interwoven that do not belong into the same place and things are done in multiple places although they could be done in one place. Examples can be found in multiple places:

1. The parser does not properly separate getting the code and getting the token stream from the code: both happens in `RewriteAndPreprocess` and in the `AttributeParser`.
2. The preprocessing logic is duplicated in the `AttributeParser`, w
 

« first day (1489 days earlier)      last day (1691 days later) »