« first day (136 days earlier)      last day (3044 days later) » 

13:10
@vba4all I fail to see how Application being all over the Office API has to mean bad encapsulation across all custom VBA APIs...
13:33
not bad encapsulation - good!
it's the same with VBIDE CodeModule and your vbeProcedure
i am having hard time coming clear with what i am trying to say
let me think about it
I feel like I missed part of the conversation....
14:08
@RubberDuck it was in relation to my comment
14:32
@vba4all Ahhhhhhh this comment. I didn't get a notification of it.
I think it's the other way around: VbeProcedure knows too much about a code module! - see why it has to be that(either) wayvba4all 4 hours ago
14:48
@RubberDuck yeah that's it but I guess my thoughts aren't clear and I have to elaborate a bit
basically how I see this connected is when I arrived at asking the question about .Application property
i was kind of thinking the same thing how can I access class A in class B but not expose too much of class A to class B while there isn't a way to access it directly
that's pretty much what the .Application property does on all VBA classes
it allows you access the base class of all the objects
and I just thought that such a base class for Matt's scenario was going to be the CodeModule
so like, either way if you want vbeProcedure to have a .Body property you still need a way to access the entire VBIDE.CodeModule (all lines, etc)
Ok so even though you may want the vbeProcedure to not know about any other procedures and their bodies the current way it's encapsulated it's using CodeModule as the base class
so if i am still making any sense ;
the vbeProcedure needs to be build from Strings. like if it has a .Body property it needs to be passed via a property assignment and have a separate factory class that's the only class to have access to the VBIDE.CodeModule
@vba4all That's the ticket I think. vbeProcedure shouldn't know about vbeCodeModule. CodMod should create procedures. Like, a proc shouldn't actually need any logic. It could almost be a type. Just a collection of properties.
As in, changing the actual procedure in the code module wouldn't necessarily change the vbeProcedure unless I write the code to keep them sync'd up.
Or maybe... maybe the damn thing is just good enough as it is, and I'm obsessing over nothing.
15:22
I just reread my monolog and i think I make no sense :P although you seem to understand where I am going with it vbeProcedure shouldn't know about vbeCodeModule.
there should be another class dealing with the sync
it should deal the cards and assign them to the right places
I still think I might be obsessing over having clean code when I already have good code.
@RubberDuck have you considered storing the procedures in a Dictionary? Key/Value pair Key would be the name of the procedure and Value would be the line number
i know it would change A LOT in the current implementation but checking the line number would allow you to quicker access the code
even better if you stored all lines in an array
array[i] is O(1)
to access the line and then that would be just super fast to check the sync
you wouldn't have to iterate through the entire CodeModule if you wanted to access a specific procedure etc.
just an idea - thought it was worth sharing at least ... feel free to tell me im dumb though ;) no heart feelings
also 1 more idea is to make use of the [_Min] and [_Max] for your own Enums
32
A: Hidden features of VBA

OorangThis trick only works in Access VBA, Excel and others won't allow it. But you can make a Standard Module hidden from the object browser by prefixing the Module name with an underscore. The module will then only be visible if you change the object browser to show hidden objects. This trick works...

15:40
My PoV is that you don't need to sync anything, the collection of procs you parse, is the state of the code at the moment you parsed it. I don't see a need to even know what line it's in; you can very well say, parse a module, sort all members, and then rewrite the module. What would you need to persist the parsed code for beyond that? I'd keep lifetime to a minimum, and assume the code can change anytime.
Like, it's almost stale right after you read it
So I'd read/parse, do work, and then assume the code has changed and destroy my instance.
16:06
I was actually thinking of implementing a Changed event for CodeModule, but then I definitely need to implement the insert, delete, etc. functionality that I never got around to.
It seems silly to re-parse the entire module at every call.
Wasteful imo
@vba4all I originally implemented a custom collection, but you might have a point about using a dict.
@Mat'sMug I also plan on implementing a tree view, so I would need to persist it in memory I think. idk. Haven't gotten that far yet.
You can't detect changes in code, unless there's an existing event for it. I haven't really studied the whole interface, it might be there..
@Mat'sMug I can if I drive all of the changes through my module class.
It won't detect user changes though.
Of course you don't need to re-parse if you're the one making the changes.. just maintain the strings and signatures... I still fail to see a need to keep a reference to CodeModule in VbeProcedure.
16:22
Ahhhhhh.. Yeah. Okay. I was missing that. Thought you were trying to say something else. I completely agree with that.
I'm thinking of making a C# addin for the VBA IDE, embed the unit testing and parsing in there somehow. There's a way to run code from the extensions right?
I think so. Haven't looked too deep into that.
Great!
So there's a way to generate AND execute VBA code from a C# IDE extension then
16:42
yes of course you can do that from an add-in
there
is a chapter on creating VBE add-ins
it's the old way but a lot of useful information
hmm.. do I buy a book for 60 pages out of 1000...
I bet there's a lot of things I didn't know in there, too...
2
 
3 hours later…
20:00
RubberDuck has made a change to the feeds posted into this room
5
Q: Checking for missing values in several columns of a spreadsheet

MalachiBasically I had 3 columns of Data Adjudicated Cases Not Adjudicated Cases All Cases and I wanted to get a list of all the cases that were missing from Column A and Column B, with a little help from @RubberDucky and his really cool Enumerable.cls (Found on GitHub in His VBX Repository) I used...

8
Q: Generating and calling code on the fly

Mat's MugDelegate This class module defines what I'm calling, in this context, a Delegate - here a function that can take a number of parameters, evaluate a result, and return a value. Close enough to the actual "delegate" thing I find. Example usage Set x = Delegate.Create("(x) => MsgBox(""Hello, "" & x

6
Q: Passing a 1D array (single column of a Range object) to .NET to manipulate it without loops and returning it back to VBA

vba4allBackground Kind of a follow up - slightly related to my other SO question. I thought that if somehow I find a way in VBA to pass a single column to .NET and convert it to a native .NET type then I could finally overcome the mystery of explicitly looping on objects via COM (which is super slow a...

17
Q: Wait, is this... LINQ?

Mat's MugContext I'm working on a little project that consists in a series of Microsoft Excel add-ins (.xlam). The code being submitted for review here, is located in the Reflection project: Feel free to comment on the project architecture, but I'm mostly interested in the Reflection.LinqEnumerable cl...

7
Q: Joining collections... because it's fun

Mat's MugI'm working on a LinqEnumerable class (reviewable here), and I'm no Big-O expert and I'm pretty bad with algorithms, so I wonder what the complexity is for what I've implemented here, and whether it could be improved. Join Correlates the elements of two sequences based on matching keys. Privat...

New question feed works. =)
 
4 hours later…
23:34
Nice!
=;)-
Any other tags I should add? Vb6, VBScript, Vb.Net??

« first day (136 days earlier)      last day (3044 days later) »