- Local time
- Today, 04:32
- Joined
- Feb 28, 2001
- Messages
- 30,014
AB: Regarding the coffee - I'm joining you in spirit despite the distance. Cheers!
VBA would be a "bad" language, not because of its limitations but because of its flexibility!!
OK you guys, this is HUGE problem in almost any platform that has been released. Doesn't matter what it is. I suspect that this is done on purpose by the creators as an attempt to give programmers multiple ways to do the same thing in the event that if one way fails or is incomprehendable, then another is available. that makes perfect sense.The fact that VBA supports multiple ways to do certain things makes it bad rather than good. It causes confusion and makes people have to think about things that they should not have to worry about.
are you sure that wouldn't result is a bitwise calculation? I've never tried it. Or would you have to use 'AND'?As an example, in VBA, the & is the concatenation operator. Therefore 1 & 1 should = 11.
javascript uses '+', so does many other languages. in PHP, it's '.'. In Oracle it's '||'. I recently did an interview and took an SQL test and the WILDCARD symbol was "%".So as a programmer reading code, you have to think about some code that is:
varX = varA + varB
I love this type of music someimes. All those uncensored cuss words. Songs that I have that fall into this category:3. Angry ghetto / gangsta rap - where they talk of popping caps (and aren't talking about bottled beer), and they talk about hoes (and aren't referring to long-handled garden implements.)
I've seen many examples over my short career of developers using one of these in favor of the other, and the one that is not used *should* be the one to use. Is there any ambiguity still present in the minds of developers regarding the purposes of these 2 declarations specs? I have a suspicion that a lot of developers don't even know the difference between the 2. Is that the case? And are there "function call" situations where it really doesn't even matter which one is used? I ran into this many many times working in aerospace.Finally, in my opinion, arguments should be byval, not byref. The programmer should need to explicitly declare byref.
I've seen many examples over my short career of developers using one of these in favor of the other, and the one that is not used *should* be the one to use. Is there any ambiguity still present in the minds of developers regarding the purposes of these 2 declarations specs? I have a suspicion that a lot of developers don't even know the difference between the 2. Is that the case? And are there "function call" situations where it really doesn't even matter which one is used? I ran into this many many times working in aerospace.
I have rarely seen byRef used. it's usually byVal, and if it's not byVal it's nothing at all.So if you make everything byval as standard, and make the programmer explicitly declare byref if that's what he wants, it makes it safer.
You don't see byRef, explicitly stated in VBA arguments because it is the default.I have rarely seen byRef used. it's usually byVal, and if it's not byVal it's nothing at all.
First of all I completely doubt there are any real "Developers" who do not know the difference. Next you will tell me you know serious developers who cannot declare variables and do not know how to build a class module.I have a suspicion that a lot of developers don't even know the difference between the 2. Is that the case? And are there "function call" situations where it really doesn't even matter which one is used? I ran into this many many times working in aerospace.
'Matters should be byval
Public Function Add2(Val as Long) as long
val = val + 2 ' acted on parameter
add2 = val
end function
'does not matter
Public Function Add2_New(Val as Long) as long
add2_New = val + 2
end function
Public Sub Test
Dim x as long
Dim y as long
x = 2
Y = add2_New(x)
debug.print x & " " & Y
y = Add2(x)
debug.print x & " " & Y
end sub
No! If it is not explicitly ByVal it is ByRef. But yes more updated languages tend to default byval. VB.NET is byval as default.if it's not byVal it's nothing at all
smarta$$.Next you will tell me you know serious developers who cannot declare variables and do not know how to build a class module.
I have asked this question before and I have had it explained to me and I didn't want to admit to Doc and Galaxiom that although they did their best to dumb it down for me, I still did not get it.
You were probably looking for something more complicated than it was.