Results 1 to 6 of 6

Thread: returning true or false [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    returning true or false [RESOLVED]

    Are these the same? which is preferred?

    VB Code:
    1. public Function SomethingToDo() as Boolean
    2.  
    3. try
    4.    trying something
    5.  
    6. catch
    7.    Error
    8.    Return False
    9. end try
    10.  
    11. Return True
    12.  
    13. End Function

    VB Code:
    1. public Function SomethingToDo() as Boolean
    2.  
    3. try
    4.    trying something
    5.  
    6. catch
    7.    Error
    8.    Return 0
    9. end try
    10.  
    11. Return 1
    12.  
    13. End Function

    Just curious if returning 0 or 1 is more accepted among coder's. I am pretty sure there is no difference but please correct me if I'm wrong.

    Oh yeah, am I using the boolean functions in the 'intended' way? to check whether or not a function was successful?
    Last edited by Andy; Apr 19th, 2004 at 08:51 AM.

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