Click to See Complete Forum and Search --> : Survey... Please fill out.
Compwiz
Nov 6th, 1999, 12:42 AM
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
tom@e-bizinternet.com
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer
Yonatan
Nov 6th, 1999, 05:14 AM
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: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
[This message has been edited by Yonatan (edited 11-06-1999).]
QWERTY
Nov 7th, 1999, 03:39 AM
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.
Phobic
Nov 7th, 1999, 04:37 AM
I use the second one :)
locutus
Nov 7th, 1999, 03:14 PM
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
JamesKirk
Nov 8th, 1999, 04:35 AM
2nd one!
Gimpster
Nov 8th, 1999, 04:37 AM
I use the second one
------------------
Ryan
corneslen@hotmail.com
ICQ# 47799046
Howard Stern
Nov 8th, 1999, 05:14 AM
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...
Al Smith
Nov 8th, 1999, 07:09 AM
I hate to admit it but, being a DOS dinosaur and a memory miser to boot, I use the &.
Al.
JorgeLedo
Nov 8th, 1999, 07:33 PM
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
j_ledo@hotmail.com
Portugal
Lloyd
Nov 8th, 1999, 07:40 PM
I use the second one. It is just more of a habit anymore.
Lloyd
HeSaidJoe
Nov 8th, 1999, 07:45 PM
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
Yonatan
Nov 9th, 1999, 02:48 AM
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: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
rgeorge001
Nov 9th, 1999, 03:37 AM
2nd one... much easier to read for interns!!!
DiGiTaIErRoR
Nov 9th, 1999, 10:26 AM
I don't...
:)
i use:
Private Part(***** As Genital) As Long
*cough* yeah
------------------
DiGiTaIErRoR
Compwiz
Nov 10th, 1999, 03:05 AM
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.
David Laplante
Nov 10th, 1999, 11:03 AM
2nd here!
XxEvilxX
Nov 10th, 1999, 12:29 PM
public FunctionListAdd(lst As Listbox)
Code:
for x = 5 to 250
lst.additem chr(x)
next x
Compwiz
Nov 10th, 1999, 09:46 PM
Evil: That is more of a subroutine (Sub) than a function.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.