|
-
Nov 6th, 1999, 01:42 AM
#1
Thread Starter
Hyperactive Member
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
-
Nov 6th, 1999, 06:14 AM
#2
Guru
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).]
-
Nov 7th, 1999, 04:39 AM
#3
Fanatic Member
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.
-
Nov 7th, 1999, 05:37 AM
#4
Hyperactive Member
I use the second one
-
Nov 7th, 1999, 04:14 PM
#5
Hyperactive Member
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
-
Nov 8th, 1999, 05:35 AM
#6
New Member
-
Nov 8th, 1999, 05:37 AM
#7
Hyperactive Member
I use the second one
------------------
Ryan
[email protected]
ICQ# 47799046
-
Nov 8th, 1999, 06:14 AM
#8
Member
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...
-
Nov 8th, 1999, 08:09 AM
#9
Hyperactive Member
I hate to admit it but, being a DOS dinosaur and a memory miser to boot, I use the &.
Al.
-
Nov 8th, 1999, 08:33 PM
#10
Addicted Member
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
-
Nov 8th, 1999, 08:40 PM
#11
Member
I use the second one. It is just more of a habit anymore.
Lloyd
-
Nov 8th, 1999, 08:45 PM
#12
_______
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
-
Nov 9th, 1999, 03:35 AM
#13
whats this VB thing people keep banging on about then?
-
Nov 9th, 1999, 03:48 AM
#14
-
Nov 9th, 1999, 04:37 AM
#15
New Member
2nd one... much easier to read for interns!!!
-
Nov 9th, 1999, 11:26 AM
#16
So Unbanned
I don't...

i use:
Code:
Private Part(***** As Genital) As Long
*cough* yeah
------------------
DiGiTaIErRoR
-
Nov 10th, 1999, 04:05 AM
#17
Thread Starter
Hyperactive Member
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.
-
Nov 10th, 1999, 12:03 PM
#18
Addicted Member
-
Nov 10th, 1999, 01:29 PM
#19
Addicted Member
public FunctionListAdd(lst As Listbox)
Code:
Code:
for x = 5 to 250
lst.additem chr(x)
next x
-
Nov 10th, 1999, 10:46 PM
#20
Thread Starter
Hyperactive Member
Evil: That is more of a subroutine (Sub) than a function.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|