Click here to Skip to main content
15,923,374 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: change string back to byte Pin
Dave Kreskowiak20-Mar-07 4:35
mveDave Kreskowiak20-Mar-07 4:35 
AnswerRe: change string back to byte Pin
Kschuler20-Mar-07 8:00
Kschuler20-Mar-07 8:00 
AnswerRe: change string back to byte Pin
emiaj14-Apr-07 7:45
emiaj14-Apr-07 7:45 
QuestionReturn a value when an exeception happens Pin
steve_rm19-Mar-07 18:29
steve_rm19-Mar-07 18:29 
AnswerRe: Return a value when an exeception happens Pin
Christian Graus19-Mar-07 19:04
protectorChristian Graus19-Mar-07 19:04 
AnswerRe: Return a value when an exeception happens Pin
Tirthadip19-Mar-07 19:15
Tirthadip19-Mar-07 19:15 
GeneralRe: Return a value when an exeception happens Pin
Dave Kreskowiak20-Mar-07 4:32
mveDave Kreskowiak20-Mar-07 4:32 
AnswerRe: Return a value when an exeception happens Pin
Johan Hakkesteegt21-Mar-07 4:26
Johan Hakkesteegt21-Mar-07 4:26 
Hi Steve,

It seems the guys misunderstood the problem you are facing. (Otherwise I misunderstood, in which case you can skip over this answer Wink | ;) )
I suppose you call this function or sub somewhere in your code, and then continue the rest of the code depending on what gets returned, right? So when an exception happens, whatever it is, you need it to return neither True nor False.

I'd say the simplest solution is to forget about the boolean and instead return an integer:

<br />
Private Function YourFunction() as Integer<br />
If something = True Then<br />
Return 0<br />
Else<br />
Return 1<br />
End If<br />
Catch Ex as Exception<br />
Return 2<br />
End Try<br />
End Function<br />

and then:
<br />
Select Case YourFunction()<br />
Case 0 'your function would have returned True<br />
<br />
Case 1 'your function would have returned False<br />
<br />
Case 2 'an exception would have occurred in you function<br />
<br />
End Select<br />


Hope this helps you,

Johan

My advice is free, and you may get what you paid for.

QuestionMake usercontrol that doesn't steal focus Pin
TwoFaced19-Mar-07 14:06
TwoFaced19-Mar-07 14:06 
AnswerRe: Make usercontrol that doesn't steal focus Pin
Christian Graus19-Mar-07 16:19
protectorChristian Graus19-Mar-07 16:19 
GeneralRe: Make usercontrol that doesn't steal focus Pin
TwoFaced19-Mar-07 19:11
TwoFaced19-Mar-07 19:11 
QuestionMouse scroll wheel and MSHFlexGrid Pin
Barry True19-Mar-07 10:20
Barry True19-Mar-07 10:20 
AnswerRe: Mouse scroll wheel and MSHFlexGrid Pin
Dave Kreskowiak19-Mar-07 10:36
mveDave Kreskowiak19-Mar-07 10:36 
GeneralRe: Mouse scroll wheel and MSHFlexGrid Pin
Barry True27-Apr-07 8:29
Barry True27-Apr-07 8:29 
QuestionWhich .DLL is used to delete IE7 cache? Pin
gacman19-Mar-07 9:35
gacman19-Mar-07 9:35 
Questiondataset.acceptchange method.. [modified] Pin
manni_n19-Mar-07 7:59
manni_n19-Mar-07 7:59 
AnswerRe: dataset.acceptchange method.. Pin
Dave Kreskowiak19-Mar-07 8:51
mveDave Kreskowiak19-Mar-07 8:51 
GeneralRe: dataset.acceptchange method.. Pin
manni_n19-Mar-07 9:04
manni_n19-Mar-07 9:04 
GeneralRe: dataset.acceptchange method.. Pin
Dave Kreskowiak19-Mar-07 9:27
mveDave Kreskowiak19-Mar-07 9:27 
GeneralRe: dataset.acceptchange method.. Pin
manni_n19-Mar-07 10:07
manni_n19-Mar-07 10:07 
GeneralRe: dataset.acceptchange method.. Pin
Dave Kreskowiak19-Mar-07 10:41
mveDave Kreskowiak19-Mar-07 10:41 
QuestionSyncoronize between sql2005 database Pin
Richard Segerlund19-Mar-07 5:37
Richard Segerlund19-Mar-07 5:37 
AnswerRe: Syncoronize between sql2005 database Pin
Dave Kreskowiak19-Mar-07 13:33
mveDave Kreskowiak19-Mar-07 13:33 
GeneralRe: Syncoronize between sql2005 database Pin
Richard Segerlund22-Mar-07 3:20
Richard Segerlund22-Mar-07 3:20 
Questionremoving xmlns=&quot;&quot; [modified] Pin
ONeil Tomlinson19-Mar-07 4:48
ONeil Tomlinson19-Mar-07 4:48 

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.