Results 1 to 20 of 20

Thread: Survey... Please fill out.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    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

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    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).]

  3. #3
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    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.


  4. #4
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263

    Post

    I use the second one

  5. #5
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    UK
    Posts
    300

    Post

    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

  6. #6
    New Member
    Join Date
    Oct 1999
    Posts
    2

    Post

    2nd one!

  7. #7
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    I use the second one

    ------------------
    Ryan
    [email protected]
    ICQ# 47799046

  8. #8
    Member
    Join Date
    Jun 1999
    Posts
    38

    Post

    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...


  9. #9
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Post

    I hate to admit it but, being a DOS dinosaur and a memory miser to boot, I use the &.
    Al.


  10. #10
    Addicted Member
    Join Date
    Oct 1999
    Location
    Oporto, Portugal
    Posts
    134

    Post

    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

  11. #11
    Member
    Join Date
    Jun 1999
    Posts
    44

    Post

    I use the second one. It is just more of a habit anymore.


    Lloyd

  12. #12
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Post

    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

  13. #13
    Guest

    Post

    whats this VB thing people keep banging on about then?


  14. #14
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    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



  15. #15
    New Member
    Join Date
    Nov 1999
    Location
    Pittsburgh, PA, USA
    Posts
    6

    Post

    2nd one... much easier to read for interns!!!

  16. #16
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    Post

    I don't...

    i use:
    Code:
    Private Part(***** As Genital) As Long
    *cough* yeah

    ------------------
    DiGiTaIErRoR

  17. #17

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    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.

  18. #18
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241

    Post

    2nd here!

  19. #19
    Addicted Member
    Join Date
    Jul 1999
    Posts
    219

    Post

    public FunctionListAdd(lst As Listbox)
    Code:
    • Code:
      for x = 5 to 250
      lst.additem chr(x)
      next x

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    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
  •  



Click Here to Expand Forum to Full Width