-
I would like to know how other programmers define their return values (if that is what it is called anyway.) I mean, do you use this:
Public Function myFunction&()
or:
Public Function myFunction() As Long
I use the second one, but I want to see how other programmers do this.
Thanx.
------------------
Tom Young, 14 Year Old
[email protected]
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer
-
There's absolutely no difference. I use the second one - easier to remember Long = Long than to remember & = Long.
Here's the complete table for anyone who's interested:
& = Long
% = Integer
$ = String
# = Double
! = Single
@ = Currency
Nothing = Variant
Decimal: (As Decimal unsupported)
Dim MyDecimal As Variant
MyDecimal = CDec(0)
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
[This message has been edited by Yonatan (edited 11-06-1999).]
-
I use the second one either because it is easier to read it (and understand for someone who doesn't know those shortcuts)
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.
-
-
I use the second one as well, In fact I have just put together a document to be used within my design team which gives coding standards to be used by the group. In the document it is stated that the second method should always be used. I think I may be correct in saying ( and please nobody take offence ) that your first method is a slightly older approach to coding ie vetrans of programming may use this method.
> outta here
>locutus
-
-
I use the second one
------------------
Ryan
[email protected]
ICQ# 47799046
-
i didnt even know the first method existed :)
so i use the second too
------------------
I swear you guys rip on me 13 or 14 more times, i'm outta here...
-
I hate to admit it but, being a DOS dinosaur and a memory miser to boot, I use the &.
Al.
-
2nd one.
Code should be putted together so that someone else in your company (or yourself in some months) coud read it and solve any problem if necessary.
------------------
Jorge Ledo
[email protected]
Portugal
-
I use the second one. It is just more of a habit anymore.
Lloyd
-
I like the first....I'm lazy...less typing...but from all accounts it looks like #2 has more reasoning going on it's behalf.
Wayne
-
whats this VB thing people keep banging on about then?
:p
-
Mark:
What's the connection between the shortcuts and C++? You have no shortcuts in C++.
VB:
Dim A As Long, B&
C++:
long A, B;
And... Do you (or anyone else) know where (on the web) I can learn Assembly for free? :)
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
-
2nd one... much easier to read for interns!!!
-
I don't...
:)
i use:
Code:
Private Part(***** As Genital) As Long
*cough* yeah
------------------
DiGiTaIErRoR
-
When I used to program in QBasic I used the first one, but now that I am in Visual Basic, I've switched over to the second one.
-
-
public FunctionListAdd(lst As Listbox)
Code:
Code:
for x = 5 to 250
lst.additem chr(x)
next x
-
Evil: That is more of a subroutine (Sub) than a function.