« first day (137 days earlier)      last day (3043 days later) » 

01:25
You can add VB6 & VBScript... but VB.net is beyond the scope of this chatroom IMO ;)
Fair enough.
 
11 hours later…
12:28
I think I have accidentally implemented an imitation of an out parameter for a multi-parameter Get Property ;)
I know it's a bit stupid but in conjunction with the fact that you can pass multiple parameters to the GET and LET property that's awesome
Class1:

Public Property Get OutProp(Optional theOut As Variant) As Variant
Prop = theOut
End Property

Public Property Let OutProp(Optional theOut As Variant, what As Variant)
theOut = what
End Property
Module1:

Sub Main()

Dim c As New Class1

Dim out As Variant

c.OutProp(out) = 5

Debug.Print out

End Sub
another layer of abstraction to explore
Doesn't the optional param need to be specified last?
2
sorry @Mat'sMug can you elaborate?
not in the LET property
that's the only exception in VBA
see THIS
12:49
@vba4all Interesting..... it does look weird, but I see why it's done that way. Although, if I saw that in someone's code I'd probably call it a smell.
As in, if you have to pass multiple arguments to a property, you're missing a class object in your design.
yea that was just an out of context example - probably too abstract to share ;)
No. I think using it as an out param is interesting. I meant the code in the SO link.
Sorry. Not enough coffee yet.
wow haven't crashed my excel in a while.... til a minute ago
haha nice!
i ain't letting it just crash
i have to know why it crashed!
13:04
RubberDuck has made a change to the feeds posted into this room
RubberDuck has made a change to the feeds posted into this room
Okay guys. I'm gonna blow up the room for a minute. Hold tight.
RubberDuck has stopped a feed from being posted into this room
RubberDuck has stopped a feed from being posted into this room
RubberDuck has stopped a feed from being posted into this room
RubberDuck has made a change to the feeds posted into this room
@StackExchange? Not going to blow up??
13:27
@RubberDuck my "wtf" sensor would be blaring at that
Hey @enderland! How are ya?
Pretty good :)
13:42
@enderland Awesome sauce. Happy to hear it.
I'm off work mondays and fridays in october, so taht's hard t ocomplain about :)
there we go
0
A: Let property of VBA class modules - is it possible to have multiple arguments?

vba4allI realise there already are 2 workarounds but I thought answering your original question was worth giving a shot due to the amount of views this question is receiving. The answer to Is it possible to have multiple arguments in the Let Property in VBA? is YES! It's possible. First let's...

+ bonus if the OP notices it as he's still active (seen 4 hours ago) maybe I can steal the accepted mark or maybe at least the community can make my answer stand out through voting
14:00
Interesting
that's just an easy one to pull off
what I am already thinking of doing with this is beyond whats currently p̶o̶s̶s̶i̶b̶l̶e̶ discovered in VBA :>
im kinda feeling good as 10K+ people have seen this question and there was no "right" answer to it yet
im feeling so good i am going to go grab myself a coffee and have a quick smoke :)
I'm trying to think through whether multiple arguments to "let" is a "Constructor" enough idea for me or not ;)
also wtf would you ever pass an argument to a Get method for
that seems like the most convoluted thing in the entire. world.
14:24
naugh!
consider
Public Property PayDay(theMonth as Byte) as Date
' return the payday for the month
End Property
now, being able to pass an out (C# imitation) as optional parameter to the get/let property and making THAT property the default for the class ... hm parameterized constructor?
in relation to this one
11
Q: Pass arguments to Constructor in VBA

ikaros45How can you construct objects passing arguments directly to your own classes? Something like this: Dim this_employee as Employee Set this_employee = new Employee(name:="Johnny", age:=69) Not being able to do this can very annoying, and you end up with dirty solutions to work this around.

obviously the new Class(params) will NOT work in VBA but besides the static class thing maybe we can somehow come up with a solution
btw. Another interesting thing I haven't cracked yet is: Unload Userform1
tell me I am mad BUT...
what if: you call a procedure: AnalyseMyCode
that finds where you are creating objects using the

`Set myObj = new MyObj(param1, param2)`

syntax, and translates that to a proper syntax vba accepts? :O
obviously, all happening in a class module and the AnalyseMyCode is just a wrapper
14:43
We've done crazier things though.
14:59
welcome @Jean-FrançoisCorbett
15:17
Someone pop by and instantly leave?
he was here for a while didn't say much though
Whew.... 391 non-wiki answer.
 
1 hour later…
16:37
@Mat'sMug I'm ready to award that bounty. Think you can score 50 points somewhere today?
Or rather, 35.
17:03
Wow thanks! I'll try, but today is awfully busy here
I know the feeling. May the odds be ever in your favor.
 
2 hours later…
18:57
@enderland Public Property Get Item(ByVal index As Long)
@ptwales to the rescue.
super late
19:37
@ptwales hmm, I guess that would be a good use huh ;)
19:50
@ptwales nah. It's not as noisy in here as the 2nd monitor.

« first day (137 days earlier)      last day (3043 days later) »