« first day (404 days earlier)      last day (2776 days later) » 

12:01 AM
RELOAD!
[ckuhn203/VBEX] 22 commits. 2313 additions. 573 deletions.
[Hosch250/Rubberduck] 4 commits. 165 additions. 21 deletions.
[rubberduck-vba/Rubberduck] 2 commits. 16 additions. 7 deletions.
[Zomis/Server] 4 commits. 1 opened issue. 1 closed issue. 1 issue comment. 96 additions. 60 deletions.
 
12:20 AM
@RubberDuck So, I have an in-person interview scheduled for next week at that software dev firm I applied at
 
@Hosch250 I anticipated someone saying that :-)
@Mat'sMug @RubberDuck @cheezsteak Thanks for the thoughts guys. I was interested in whether anyone had a good reason for doing that. It seems weird when you have a statically typed language not to use it.
BTW I just got back after the interview now.
@Mat'sMug But wouldn't you be worried about changing all that code without unit tests?
Man, am I getting paranoid in my old age or what?
 
@Rossco I thought you said it was next week?
 
I said 'in a couple'
which actually meant in a couple of minutes.
Which I'm not surprised you didn't understand ;-D
 
Oh, it is Phrancis next week.
 
It was pretty rapid, I only applied for it 24 hours ago and the company emailed me back immediately.
 
12:28 AM
Is that good, or suspicious?
 
I was doing some quick swotting on their company and thats when I noticed the implicit typing thing.
 
It means either they are on the ball, or desperate, I guess.
So, how did it go?
 
Well, it is a small company.
The thing is that I'm unemployed at the moment
and I need to get something going.
 
I wish I could get on a company I really cared about instead of doing nothing.
The only thing I would miss is not being with my dog all day.
I mean, I have RD and a couple other projects, but...
 
My problem is that all the jobs I would like are in Auckland (== 1 hour drive from here).
 
12:31 AM
Hmm, either move, work from home, or can't take them, I guess.
 
But I need want to stay where I am until I finish this last paper at uni.
 
Actually, I've taken classes with people who drive about an hour away from where they work.
How long until you finish the paper?
 
Actually its more like 1.5 hours or 2 with peak hour traffic.
@Hosch250 Paper starts tomorrow.
 
@Rossco OK, but I've had papers where I have 1 week-, or 5 weeks+ to get them done.
 
Finishes end of October.
 
12:33 AM
Oh, a couple months.
 
Yup.
 
BTW, what are you taking again?
 
computer science.
 
OK. Do you study algorithms and stuff?
 
specifically this is a 2nd year paper about OO programming (in Java)
 
12:34 AM
OK.
 
Umm, I should do a paper on algorithms some time. I haven't so far.
 
Do you know anything about Bachelor final projects?
 
this one may have algorithms in it. I'll let you know as it progresses.
 
I have a whole class my last semester with a final project.
 
@Hosch250 not really. I'm not doing a major for CompSci so its not part of my degree.
 
12:35 AM
I know nothing about IT, and I'm not really interested in it, so I'm not sure what or how I'll do.
 
I'm sure with the work you've been doing with RD that a final's project will not be difficult for you.
 
Most excellent @Phrancis! Good luck!
 
But that's CS, not IT.
 
yeah, I know.
 
OK. Thanks for the encouragement.
 
12:37 AM
university is not as hard as the real world.
 
@Rossco So I've found very drily
 
lol
 
Amen @Rossco
 
Is your project a solo or group one?
 
I have no idea.
Let's just say that at this point, I have no idea about anything.
 
12:38 AM
Group ones are terrible. Hopefully its solo.
 
I've finished my generals, and I've only taken 3 upper level classes.
 
At least you have some experience working on software as part of a team.
 
For sure. ^
 
I'm sure my project will have to involve networking or system administration or something.
 
I had my first group project last semester and I ended up carrying the others.
 
12:40 AM
@Rossco Don't you hate that?
Was there no way you could walk out and demand new teammates?
 
Totes, and if its a group project its usually larger which makes it quite burdensome.
Nah, there wasn't. I didn't mind too much. Like I said its the first time I've had to do it and I've done 40+ papers.
 
So glad I skipped out on higher Ed. Got mine the old fashioned way.
 
@RubberDuck Be glad, and don't look back.
You know more about stuff than I will for years anyway.
 
I'm only doing mine the second time around so I can get an interview rather than miss out because the HR manager doesn't see a qualification.
 
Yeah. That's the hard part. No doubt.
 
12:43 AM
gtg now guys. Will catch y'all later on.
 
See you.
 
Cya buddy.
Bah. Web is weird... What have I gotten myself into?
 
@RubberDuck Thank you!
 
I hope you get it man. I'm tired of seeing SNAP errors in here... =;)-
 
@RubberDuck Got anything else ready to be tested?
Wait, I'll move Rename to the Builder.
 
12:59 AM
I've no idea @Hosch250. Haven't opened the project in a week.
Been absorbing a lot of info. Makes it hard to want to code after work.
 
1:40 AM
@Rossco On a good day, my commute is 50 minutes. and hour drive isn't that bad, especially in Australia - it's a big island!
 
@Hosch250 honest, how do you find the builder thingy?
 
Not bad.
Sometimes it seems to need more data than I actually need to set up the tests.
Also, I had to add a line of code somewhere in there to let renaming a module work.
Set up the CodeModule.Name property.
 
I don't know if you want to look into this, but in one test, I had to set up the VBProjects list thing.
@Mat'sMug Just mentioned that ^^
 
There, caught some dead code.
Also:
var projects = MockFactory.CreateProjectsMock(new List<VBProject>() { project });
vbe.Setup(v => v.VBProjects).Returns(projects.Object);
I don't know if you want to move that to the builder?
 
[rubberduck-vba/Rubberduck] build for commit 17ff5321 on ???: AppVeyor build succeeded
 
@Hosch250 that would be an easy one :)
 
I had to do that for the Rename Project test.
Now for a question.
The whole reason for mocking is so we don't have the whole blooming thing set up to fail in a zillion places for the test, isn't it?
 
@Hosch250 it does. however it's guaranteed to set up a mock IDE that can be navigated up and down its components - whatever the SUT does with it, should just work
 
1:52 AM
Do we really want to set up a full IDE with everything we do and don't need to test a specific thing?
 
@Hosch250 I think a CodeModule object all by itself makes no sense. It has a VBE property that the SUT can call (or not), and that VBE property has a Projects collection that can be navigated back into the CodeModule we're working with.
I'm pretty confident that setting up a Mock<VBE> for all tests, will result in much more solid tests.
 
Well, if we have a full IDE set up, our tests are less likely to fail because we didn't set something up.
 
^^ and that
 
So, @Mat'sMug, you have it set up to let me test renaming a button on a form?
 
yup
 
2:02 AM
OK, figuring that out now.
 
there's an example in my latest CR question :)
 
I see that.
 
2:13 AM
var project = builder.ProjectBuilder("TestProject1", vbext_ProjectProtection.vbext_pp_none)
    .AddComponent("Class1", vbext_ComponentType.vbext_ct_ClassModule, inputCode)
    .UserFormBuilder("Form1", "")
    .AddControl("Button1")
    .Build().Object;
How am I supposed to get that, but build the project, not the form?
 
call the ProjectBuilder method to build the form and add it as a component to the project, and get the ProjectBuilder instance
so
var project = builder.ProjectBuilder("TestProject1", vbext_ProjectProtection.vbext_pp_none)
    .AddComponent("Class1", vbext_ComponentType.vbext_ct_ClassModule, inputCode)
    .UserFormBuilder("Form1", "")
    .AddControl("Button1")
    .ProjectBuilder().Build().Object;
 
var project = builder.ProjectBuilder("TestProject1", vbext_ProjectProtection.vbext_pp_none)
    .AddComponent("Class1", vbext_ComponentType.vbext_ct_ClassModule, inputCode)
    .UserFormBuilder("Form1", "")
    .AddControl("Button1")
    .MockProjectBuilder()
    .Build().Object;
Like that?
 
yeah that
 
OK, did you test this?
Because it doesn't even get past the parser.
It says the form doesn't have one of the required method/property thingies set up.
Also, do you have the Properties property/method set up?
Because the Rename uses that extensively.
(Well, sort of.)
Dishes, BBL.
 
2:28 AM
@Hosch250 nope
I haven't figured out properties yet
 
 
1 hour later…
3:44 AM
#707 could be worked on in the mean time ;-)
 
@Mat'sMug No repo.
 
in Access?
I think he means Access forms, not VBA UserForms
 
Oh.
I don't know the slightest thing about Access.
 
me neither. best of all, I don't even have it
looks like a job for @RubberDuck :)
 
I'll try.
@FreeMan If you send me a simple working (or rather, broken) example, or instructions on how to set one up, I'll see what I can do.
 
4:01 AM
I'm off to bed - 'night buddy
 
Night.
 
 
2 hours later…
6:23 AM
posted on July 15, 2015 by p1ngp1ng

In my last post I mentioned the ability to create a factory at run-time by accessing the VBComponents collection. To do this you must first create a Reference to: Microsoft Visual Basic for Applications Extensibility 5.3 (C:\Program Files\Common Files\Microsoft Shared\VBA\VB6\VBE6.DLL) Having done this you now have access to the VBIDE library and, in particular, the […]

 
 
3 hours later…
9:23 AM
> The parser gives the error:
extraneous input 'if' expecting NEWLINE

on the following piece of code:`

```vba
Mid(f.buffer, f.buffer_pos + 1, 1) = Chr(I)
f.buffer_pos = (f.buffer_pos + 1)
If .buffer_pos >= &H4000 Then
``

Probably because it expects mid() to be a function. However in this case it is used to assign a value, which is valid vb(a)
 
10:05 AM
> If .buffer_pos >= &H4000 Then

This looks like you're either using a `With` or you meant to write `If f.buffer_pos >= &H4000 Then`...
 
 
1 hour later…
11:24 AM
hello....
 
12:00 PM
@Hosch250 I'll see if I can work up a sample today. Took a while to realize what you were referring to...
Hi, @Meehow
 
12:36 PM
> @Vogel612 I doubt it would be that. Grammar isn't context-sensitive, *the resolver* identifies the context of an instruction.

It could be the parentheses around `(f.buffer_pos + 1)` but I can't be 100% sure until I repro. Will do that later for sure.
 
posted on July 15, 2015 by p1ngp1ng

The Singleton Design Pattern: when you only ever want one instance of a class to be in existence at any point in time. The Singleton is perhaps the easiest pattern to implement in VBA and to do so you only need to perform the following steps: 1. Declare a static variable of the same type […]

 
 
1 hour later…
1:51 PM
@Hosch250 Really simple sample Access DB created that shows the issue. How do you want it transmitted to you?
 
2:12 PM
OK, you should be able to get it from here:
 
> You should be able to find a very simple Access database with a single form and a single button here:

https://drive.google.com/folder/d/0B3Ctki7FAhFlVkswWkJHWlQ0YU0/edit

When you open the DB, the form should open and a message box stating "Form loading" will appear. When you click the button you will see a message box stating "You clicked the button".

When you run code inspections, you'll see that both of the procedures to display the message boxen will be flagged as unused.
> @Vogel612 : I did ineed use a with in the code itself, but added the variable again here in the snippet for readability: and then I omitted it once which actually did not improve the readability then.. sorry about that...
 
2:29 PM
BTW - I had to create the db, email it to myself, upload it to G drive on my phone, share the link, email the link back to my work computer, then post the link from there. Why? Because work firewalls all file hosting sites - Google Drive, Dropbox, Box... you name it we can't have nice things. :/
 
> No repro with 1.4.3 and this code:

Sub DoSomething()
With f
Mid(.buffer, .buffer_pos + 1, 1) = Chr(I)
.buffer_pos = (.buffer_pos + 1)
If .buffer_pos >= &H4000 Then Debug.Print .buffer_pos
End With
End Sub

Or this code:

Sub DoSomething()
Mid(f.buffer, f.buffer_pos + 1, 1) = Chr(I)
f.buffer_pos = (f.buffer_pos + 1)
If f.buffer_pos >= &H4000 Then Debug.Print f.buffer_pos
End Sub

Howev
 
@Duga if VBA can't handle it, Rubberduck won't handle it either.
 
2:47 PM
> OK, the code compilesand works. here is the complete sub

```vba
Private Sub BinWrite(ByRef fFile As BinFile, ByVal intChar As Integer)
With fFile
Mid(.buffer, .buffer_pos + 1, 1) = Chr(intChar)
.buffer_pos = (.buffer_pos + 1)
If .buffer_pos >= &H4000 Then
Put .file_num, , .buffer
.buffer_pos = 0
End If
End With
End Sub

``
 
ah, now I have a repro
 
[bug][status-acknowledged]
 
^^
 
2:55 PM
got it
 
already found?? that was fast
 
> @Ronaldvr found it, thanks!

It's a grammar bug, specifically with the `fileNumber` grammar rule:

fileNumber : '#'? (ambiguousIdentifier | INTEGERLITERAL);

The rule is expecting an identifier, so until I fix the grammar to make it expect a `valueStmt` (which may cause other unsuspected issues - we'll see!), a temporary fix could be to introduce a local variable to hold the file number - this code parses fine:

Private Sub BinWrite(ByRef fFile As BinFile, ByVal intChar As Inte
 
@Duga #WhyContextMatters
 
3:37 PM
> Thanks for the quick follow up @retailcoder! The workaround will do for me for the moment thanks!
 
4:06 PM
OK, @Mat'sMug, I have a repo on 707.
The inspection appears to work right - RD can't see the event being fired from the form, it appears.
This is all we have in the VBE:
Option Compare Database
Option Explicit

Private Sub Command0_Click()

  MsgBox "You clicked a button!"

End Sub

Private Sub Form_Load()

  MsgBox "Form is Loading"

End Sub
 
4:34 PM
hola
 
hi!
 
yo!
 
Did I miss anything this morning other than #714?
@FreeMan got it. Will check it out.
@StackExchange That is NOT the singleton pattern....
 
@RubberDuck I already checked it out a bit.
See my notes ^^
 
@RubberDuck What @Hosch250 said...
@Hosch250 there
 
4:39 PM
@RubberDuck and their "factory" wasn't a factory either
I'm quite disappointed with that blogger
shall we show 'em how it's done?
 
@Mat'sMug yes
please...
 
lol
 
whachulaughingatmug?
yeah, I really need to start learning more stuff. When I started programming, "objects" were pinned to the wall on a calendar.
 
4:56 PM
I'm already drafting a post in my head to rebuttle that one @Mat'sMug. Lol
 
> A singleton can only ever be instantiated once
anything that can be New'd up won't be a singleton
it's not up to the user to decide whether or not to use a "factory" to instantiate it
I'd go the usual way, and make it a PublicNotCreatable type in a separate library
but then, what's complicated isn't to ensure there can be only 1.
what's complicated is ...making that type useful in any way!
 
I just thought it was absurd to raise an error instead of returning the existing instance.
 
@RubberDuck that too
 
 
2 hours later…
6:52 PM
0
Q: Renaming mulitple PDF files

Michael PachecoI have to modify an existing VBS script that downloads a PDF from a remote location and renaming, then moving to a source directory on another server. Now, we are introducing a new PDF file from the remote location and it has to be renamed and moved to another source directory on another server....

 
 
1 hour later…
8:05 PM
@Mat'sMug / @RubberDuck around? Got a SQL Server question
 
 
3 hours later…
11:29 PM
@Phrancis you still around? Still have question?
 
Hey @Phrancis. Sorry buddy. Here now. Kind of at least.
 
No worries. Just came across a scenario at work that got the gears turning a bit, but I don't really know how to approach it
Say I have two tables:
1) ContractId PK, SequenceId PK, ProductId
2) ProductId PK, ProductDescription
 
Yup
 
Notice the ProductId in the first table has no FK constraint
 
Yup
Is there a reason for that?
 
11:33 PM
So let's say I want to either update or insert into (1), but make sure that the ProductId exists in (2), is there a way to do this within a transaction?
@Rossco Bad design
Ported from Access DB to MS SQL DB when the data sets grew too large for Access.
 
Well you will need to select the pid from 2 at some point to create the insert into 1
So select pid into a variable and then check if it is null
Throw an exception or rollback transaction if it is.
 
Something like IF @pid IS NULL ROLLBACK ELSE INSERT INTO Table1 VALUES (12345, 1, @pid); COMMIT; I guess?
 
Or if you already have the pid and just need to confirm it exists then use an if exists...
 
That's closer to my use case ^
 
Yeah I thought so. Obviously it would be exceptional for the key not to exist.
 
11:39 PM
You'd be surprised ;)
 
Lol
 
When you're working with bleeding edge VB6 applications, and spreadsheets shared by multiple users on a team that know nothing about databases requesting data changes...
The key checks are done at the application level rather than at the DB level, which I hate. I had one just today that was flagged as an underwriter exception because of a non-existent pid that I didn't notice. It's in the DB, but when you try to pull the record at the application level, it's conspicuously absent, with no errors or anything like that.
 
What a headache. Hey listen bud, I've got to go. I hope that helped
 

« first day (404 days earlier)      last day (2776 days later) »