Click here to Skip to main content
15,920,896 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: ByRef vs Return Pin
Dave Kreskowiak6-May-08 3:45
mveDave Kreskowiak6-May-08 3:45 
GeneralRe: ByRef vs Return Pin
Kevin Brydon6-May-08 4:43
Kevin Brydon6-May-08 4:43 
GeneralRe: ByRef vs Return Pin
Dave Kreskowiak6-May-08 4:55
mveDave Kreskowiak6-May-08 4:55 
GeneralRe: ByRef vs Return Pin
Kevin Brydon6-May-08 5:54
Kevin Brydon6-May-08 5:54 
GeneralRe: ByRef vs Return Pin
Dave Kreskowiak6-May-08 6:17
mveDave Kreskowiak6-May-08 6:17 
AnswerRe: ByRef vs Return Pin
Guffa6-May-08 6:41
Guffa6-May-08 6:41 
GeneralRe: ByRef vs Return Pin
supercat96-May-08 6:50
supercat96-May-08 6:50 
GeneralRe: ByRef vs Return Pin
Guffa6-May-08 9:35
Guffa6-May-08 9:35 
supercat9 wrote:
Another possibility which may ease things for the caller would be to have similar versions of the function, one of which will throw an exception if it can't retrieve a course for any reason, and one of which will simply return nothing in the case where it can tell that a course does not exist (it will still throw an exception in case of things like database error and so forth).


More of a complement than an alternative... That could easily be accomplished with a method that gets a course and throws an exception if it's null:
Public Function GetCourseUnconditionally(courseId As Integer) As Course
   Course result = GetCourse(courseId)
   If result Is Nothing Then
      Throw New AppplicationException("Course not found.");
   End If
   Return result
End Function


Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: ByRef vs Return Pin
Kevin Brydon7-May-08 6:26
Kevin Brydon7-May-08 6:26 
Questionsearching in listview Pin
idi6-May-08 2:45
idi6-May-08 2:45 
AnswerRe: searching in listview Pin
Dave Kreskowiak6-May-08 3:38
mveDave Kreskowiak6-May-08 3:38 
GeneralRe: searching in listview Pin
idi7-May-08 1:21
idi7-May-08 1:21 
GeneralRe: searching in listview Pin
Dave Kreskowiak7-May-08 2:01
mveDave Kreskowiak7-May-08 2:01 
Questionsend messages to cell phones Pin
Siboniso6-May-08 1:54
Siboniso6-May-08 1:54 
AnswerRe: send messages to cell phones Pin
Christian Graus6-May-08 1:56
protectorChristian Graus6-May-08 1:56 
QuestionResize / Reduce / shrink Image Size Pin
nishkarsh_k6-May-08 1:36
nishkarsh_k6-May-08 1:36 
AnswerRe: Resize / Reduce / shrink Image Size Pin
Christian Graus6-May-08 1:57
protectorChristian Graus6-May-08 1:57 
QuestionRe: Resize / Reduce / shrink Image Size Pin
nishkarsh_k6-May-08 3:57
nishkarsh_k6-May-08 3:57 
AnswerRe: Resize / Reduce / shrink Image Size Pin
John Weinhold6-May-08 9:53
John Weinhold6-May-08 9:53 
GeneralRe: Resize / Reduce / shrink Image Size Pin
nishkarsh_k6-May-08 10:01
nishkarsh_k6-May-08 10:01 
GeneralRe: Resize / Reduce / shrink Image Size Pin
John Weinhold6-May-08 10:26
John Weinhold6-May-08 10:26 
QuestionGUI Problems Pin
Tauseef A6-May-08 1:15
Tauseef A6-May-08 1:15 
AnswerRe: GUI Problems Pin
Christian Graus6-May-08 2:00
protectorChristian Graus6-May-08 2:00 
QuestionAcces Denied Pin
Zaegra6-May-08 0:36
Zaegra6-May-08 0:36 
AnswerRe: Acces Denied Pin
Eduard Keilholz6-May-08 1:02
Eduard Keilholz6-May-08 1:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.