« first day (164 days earlier)      last day (3016 days later) » 

12:01 AM
I think things have a chance of starting of get easier to implement from there.
I'll write a couple of other tests, and then I'll put up the Parser class on CR, commit / push my changes, and then create a new issue for each language construct that needs an ISyntax implementation.. and the parser should just automagically "understand" them as they get added.
 
Holy regex @Batman @Mat'sMug.
 
12:35 AM
yeah.. they're all tucked inside shoved into the VBAGrammar static class though
 
 
1 hour later…
1:40 AM
ok, pushed the parser.
@RubberDuck I moved some things around, there shouldn't be any conflicts if you only had menus & UI stuff checked out.
 
Oh. Cool.
 
still a few issues, but they're node-implementation-specific, the parser seems to work, all tests pass.
 
Yeah. That's the only changes I've made.
 
for some reason I only get 3 nodes when I parse System.EscapeSequence from my System.xlam add-in.
weird
looks like 15 tests aren't enough
 
I need to take a look at what you've been up to. I'm curious.
 
1:47 AM
I usually put a breakpoint on the return result; line in the Parse method, and then launch the debugger and find a module I want to parse, and click "Parse module" from the Rubberduck/Refactor menu.
obviously that's not going to stay
 
Right.
There are never enough tests either. =)
 
EnumMemberSyntax doesn't work :(
ah, works now.. except it's parsed as a CodeBlockNode
@RubberDuck everything that has child nodes will be treated as a CodeBlockNode... think Enum, Type, For...Next, If...Then...Else, etc. - should we have EnumNode, TypeNode, ForNode, etc., or we can walk away happy with CodeBlockNodes?
hmm
 
2:19 AM
I'm not happy with this.
I think the Parser needs some INodeFactory abstract factory to produce the appropriate node types.
ah, it's the End Property that doesn't get picked up.. that's why EscapeSequence nests all properties under the same node.
like, it's looping until it finds an End Property Let!
 
Lol. Nice!
Shouldn't EnumNode, etc all be types of CodeBlocks?
 
they are
but CodeBlockNode isn't abstract, so I'm newing it up as a CodeBlockNode, which causes everything to be a "code block" with impossible upcast to EnumNode
 
Okay, I don't quite grok what you're saying then. I need to check out the code.
Ohhhhh. Ok. I'm following now.
 
2:39 AM
I tried stirring in some generics, but for it to work I had to add a method in Parser - that's how ProcedureNode gets added as a ProcedureNode
and I don't want to add a new Parser method everytime I implement a CodeBlockNode...
 
Yeah. That's a bit of a smell, isn't it?
 
totally
that code is screaming "gimmeh teh node factory" in big caps
but I mostly focused on getting it to work first :)
it's ...ugly as Hell
 
Yeah. Kind of like how the UI is begging for a base Menu class...
 
probably
no panic here, it's iterative and fine like that :)
I'm sure we'll end up with something nice both as an app and as a code base
did you sync?
can't wait to be done with the parser and start implementing the code inspections.. that's going to be so cool!
some of 'em can already be implemented with the few little bit of grammar that's there
anything that has to do with identifiers, signatures, parameters
if we're going to have a recommendation to say "Invert If to reduce nesting", I think it's going to be easier if the tree has IfBlockNode nodes
 
2:58 AM
I've not touched my machine since yesterday morning. Will sync tomorrow.
And yes, I think life will be easier if we have those kinds of concepts to work with.
I'm heading to bed Mug. I need another weekend to recover from my weekend. =)
 
'night!
 
 
5 hours later…
8:20 AM
Bounty offered as promised
4
Q: Creating an object oriented model in VBA using COM and ADODB from 2 depended SQL tables

vba4allThe story... A bit of background info and how is the database designed... Please notice you don't really have to rebuild the tables in SQL but I shared an SQL Fiddle just in case and screenshots1 of what the database looks like. I thought it was going to be easier to explain the story of what I...

 
 
2 hours later…
10:31 AM
Oh yeah. I forgot about that one.
> One thing though - please pretend my variable named c has a proper, more suitable name. That c for Collection is like i in a for loop for me ;)
Ha! I didn't even notice it until I read that!
 
10:52 AM
@RubberDuck haha i know bad habits but please excuse me and treat this as an exception
have been using Collections so much that i naturally assigned it a letter
also, another bad habit
using any COM ( ya know, quick debugging and checking it from vba ) its always called c when I dont use collections
when there are also collections involved i do com for COM lib and c for collection
BTW. interesting Q/A
5
Q: How does a COM server marshal nullable in C# class library with different ComInterfaceType Enumerations?

vba4allI hear that Nullable<T> is a C# generic class and it does not work with COM - like any other generic class. Well, in my C# class library I have: [InterfaceType(ComInterfaceType.InterfaceIsDual), Guid("2FCEF713-CD2E-4ACB-A9CE-E57E7F51E72E")] public interface ICOMClass { int? GetNullable(); }...

now that makes me question whether Early Binding in VBA is really a true early binding... lol
 
11:11 AM
Lol. @vba4all I also use just c when I create a custom collection. That's why I missed it.
Okay, now that's a bad habit though. =;)-
 
12:07 PM
Hey @Mat'sMug thinking of single letter variable names, do you think it's possible to use your parser to replace variable names wholesale?
 
12:26 PM
Not by renaming the node, but to locate the exact places yeah
 
12:37 PM
I made Identifier override Equals and GetHashCode for that purpose
We'll need functions to search the tree
 
1:11 PM
Each SyntaxTreeNode has an Instruction, and each Instruction knows its StartColumn, EndColumn and LogicalCodeLine - and there's a module line number for each LogicalCodeLine. So we can make a Selection out of any SyntaxTreeNode pretty easily.
 
1:31 PM
Nice. That will be cool to implement down the line.
 
 
1 hour later…
2:49 PM
Yeah. I need some unit tests for that too, so that we can tell whether a code block is properly indented
 
 
2 hours later…
4:46 PM
do all code blocks automatically mean an indentation level? hmm...
 
5:13 PM
i guess that depends on what a codeblock is, but I would imagine so. I can't think of one that wouldn't be.
 
at the end of the day, it's what we decide to make it ;)
but so far I've used it for when the parser needs to "enter a code block" and "scan" an unknown number of logical code lines to complete the code block node.
like, an EnumNode is one, TypeNode is another; ProcedureNode is obviously one, IfBlockNode also, and then everything else I can think of just works that way too... I guess it's right.
 
5:45 PM
Is there a good way to start debugging on pressing a button without setting a breakpoint? like, press button with Shift or something?
 
^^
 
Shift F8 does not step into
 
@cheezsteak lol @namechange :)
 
I mean, hitting a button on a form without selecting the code to execute first and hitting F8
 
5:48 PM
Stop
or Debug.Assert False
 
so no way without jumping to editor is what i am gathering :P
 
you could always resize the VBA editor and see the form and the current line of code :)
 
@enderland I don't follow. For production or development?
 
Development. Basically I want a faster ability to "hit button and start debugging" route than having a stop/debug.assert statement or manually going into the form VBA (either through design mode --> "on action" or find/etc)
 
Hmmmm can you "click" a built in command bar button with vba?
Hijack the IDE with something like....
Application.VBE.Commandbars("Somecommandbar").Controls("The play button")....
 
5:55 PM
It's just an annoying amount of work to have a form in non-design view, to jump straight to the code that different buttons do
 
OHhhh a form......
Ignore what I just said then.
Why not write a test routine that creates a new instance of the form and then calls....
Nope.
Decouple the form from it's logic.
Create a class that handles all of the events, and make the subs public.
Then you can test the handler class without ever worrying about the form.
 
^^
in The 2nd Monitor, 22 mins ago, by Mat's Mug
and then write unit tests for it with Rubberduck :)
 
And that ^
 
but we need an installer first :)
 
@RubberDuck I still have to set the breakpoint though (all my events are decoupled for the most part)
 
5:59 PM
Why? That's exactly what Debug.Assert() is for.
Or better yet, there's Rubberduck's unit testing features. =;)-
 
but then I have to put that in every method call
and turn it off when needed
One other thing I thought about was having every single callback call a sub which is empty but I can set a breakpoint there and turn it on/off
 
Unit testing ^
Also, it wouldn't be hard to write some code that replaces all instances of Debug.Assert.... with 'Debug.Assert and vice versa.
 
ha :) I am scared to get too into that. Especailly since my project work with VBA is going to come to an end at Thanksgiving...
Scared because I'd probably end up contributing, etc
You know, standard "hmmm, this is interesting" problems...
 
:)
wait, none of the code inspections are implemented yet!
 
You won't hear any complaints. We have a laundry list of things to do. =;)-
 
6:04 PM
I have not even remotely enough time outside work to do VBA at this point :-)
 
it's actually C#
 
Yah. I'd want to start learning that, too, which doesn't help at all :P
 
It's been a fun project to learn on actually. I'm still a bit n00bish at
 
I think I actually have an interview this afternoon for a .Net developer position...
2
 
90 commits already?! does issue-creating count as a commit?
 
6:22 PM
@enderland really? Best of luck (if you need it!)
 
@enderland Hey yeah! good luck man!
@Mat'sMug I tend to commit individual changes. But no, issues do not count as a commit.
 
@enderland good luck bud
 
6:39 PM
@Mat'sMug I think I do, normally I prep a ton for an interview and this weekend was a blur...
Stack Exchange makes me feel really weak as a dev :P haha.
 
I can relate to that ^^
 
(probably because my programming abilities are somewhat weak, but my "Dev" abilities are good? or better than average? idk)
 
Dunning Kreuger Effect
You know what you don't know.
 
The more I learn, the less I know
6
 
Amen
I was blissfully ignorant about what I didn't know once, then CR happened.
 
7:10 PM
I swear this project is going to drive me to drinking. Too many moving parts..... targets.
 
7:23 PM
Monking VBA folks
 
salut @Phrancis
 
Hey @Phrancis. How goes it?
 
Not bad. Figured I would come here and show you guys some of the Excel/Access related questions so hopefully improve this process a bit
 
What is the difference between solid and hollow stars?
 
hollow is pinned (and not starred by you)
 
7:36 PM
+1
 
who can pin?
 
Room owners
 
room owners & mods
 
any moderator on SE anywhere has chat moderation privaleges
but room owners can also pin (or see deleted messages)
 
7:51 PM
@Mat'sMug We use an Excel type of form that is shared by the team for data updates:
 
hahaha is @cheezsteak @ptwales?
 
@rubberduck did you not notice
 
Just now. =)
 
With the intention that the yellow field(s) is what the data record needs to be updated to (or inserted/deleted in other tabs)
With the white field to the left of it being what the data currently shows (required for audits/approvals)
 
7:53 PM
@Phrancis is that row 4 split or frozen?
 
Split
What's above it is not important, just general instructions
 
Why is this all one workbook?
 
When I submit the requests, I take the new rows from each and put them into individual workbooks by themselves, which has additional information including the above tab.
@cheezsteak the best answer to "why" right now is: "because"
(that's partly why I'm here, trying to improve all this mess)
 
1. Print out the workbook
2. Staple it together
3. Burn it
3
Problem solved
 
Upon saving each individual file (usually 4-6 Excel files) I have to create a Jira ticket for each, and attach them, and await approval and processing, upon which I go back to the workbook with all the tabs and update the rows
 
7:59 PM
Do you have the authority to completely restructure this process?
 
^^ he wishes
 
Because it sounds like this workbook is simulating a database with basic CRUD.
 
Not to a great extent. I'm limited to restructure how the requests are added (the first workbook) and how they are saved (the 2nd screenshot)
Anything after that (the Jira tickets, approval, processing) I have no say into. I have authority on how the workbook is updated as requests are submitted and processed.
 
I would make a UML diagram of this workbook because it sounds intense.
 
If there was something that could fetch the records from each table where the ticket number/date submitted are null, save an Excel file with today's date into a folder, that would start saving me a lot of time...
 
8:05 PM
a little bit of VBA can certainly do that
 
My only other option (due to not being a dev and due to environment) besides Excel would be Access, but I wouldn't know where to start
The DB stuff I can do easily, but the rest not so much
 
Honestly, if no one else can manage the Access DB I wouldn't go that route.
 
@cheezsteak Agreed.
 
For each table in tables
For each record in table.rows
If record.cells(1, TICKET_COL).value = vbnullstring then
collec.add record
End if
next
next
 
I mean, a db with a nice UI would be ideal, but not if there's not a duck to maintain it.
Forgot the Mug works with Excel. =)
 
8:10 PM
NARDS why won't it format!
For derp to herp
    debug.print derp
next derp
 
So you can use VBA straight in Excel I hear? How do I go about doing that?
 
I'M IN YR LOOP
@Phrancis Press F11
 
alt F11
 
Speaking of derps
 
The above is what I make it look like (blue rows) upon submittal once it is awaiting for approval & commitment.
 
8:25 PM
A goal should be to remove color coding.
it requires a legend and is only convienent for humans.
 
Yes that would be a worthy goal
 
I think it's the crux of how this workbook got so mangled
 
Any color coding should be done with conditional fomatting, at least.
 
I then have to take the contract numbers and feed them into an old VB application using a separate Excel file, so that the Jira ticket information is documented in each record in our actual business DB.
And then the information will become documented in SNAP for anyone in the business to access.
So many damn steps for something so simple
 
8:30 PM
@Phrancis Somebody borked a UPC. =)
 
Sub LeadingZeros(ByRef rng As Range, ByVal zeroes_count As Integer, _
                 Optional ByVal other_char As String = "0")

    Dim zeros As String
    zeros = ""

    Dim iz As Integer
    For iz = 1 To zeroes_count
        zeros = zeros & other_char
    Next iz

    rng.Cells.NumberFormat = zeros
    ReloadValue rng
    rng.EntireColumn.AutoFit

    On Error Resume Next

    Dim txt As Variant

    Dim area As Range
    For Each area In rng.Areas
        Dim c As Range
        For Each c In area.Cells
Top ten most used procedure
There is another for trimming whitespace
 
The leading zeroes have to remain, as the data fields in SQL are NVARCHAR instead of INT even for the IDs
 
Dude, just find a new job.
3
 
IKR.
Dumb people who set up the database years and years ago decided that SQL-native IDs generated when records are inserted were too simple. So they made seeding tables instead to get IDs from. So they have to go back every couple months and make more IDs.
 
Huh I get to talk to a rep from the SETI institute as to why their Payroll file was wrong.
This really hurts because I'm a physics major and I would love to work at SETI
It be very rude to not help them and ask them for a job....
 
8:45 PM
Terribly rude.
</sarcasm font>
 
9:16 PM
Anyways, either of you have any idea where to start to improve this shit process?
 
sorry haven't been paying much attention, I'll re-read this later, I might be able to suggest something
 
All good man
 
9:51 PM
the feed has been quiet lately. We need moar code to review!
 
4
Q: Creating an object oriented model in VBA using COM and ADODB from 2 depended SQL tables

vba4allThe story... A bit of background info and how is the database designed... Please notice you don't really have to rebuild the tables in SQL but I shared an SQL Fiddle just in case and screenshots1 of what the database looks like. I thought it was going to be easier to explain the story of what I...

Still no answer.
And a bounty on it.
Besides, you and I haven't really been writing any lately, so......
 
lol true
@RubberDuck oh I will write something for this one :)
 
10:11 PM
The user certainly put some effort into writing that question, wow if only everyone did that
Nice change from I HAS CODE CAN YOU REVIEW IT code-only questions.
 
@Phrancis Yeah. That's @vba4all. His blog and answers on SO taught me a crap ton about VBA.
 
Ah nice!
 
formerly known as @mehow
 

« first day (164 days earlier)      last day (3016 days later) »