473,395 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

not all paths return a value

guy
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?

Private Function CreateFolder(ByVal sFileName As String) As Boolean

On Error GoTo Errors

'Create it if necessary
If Directory.Exists(sFileName) = False Then
Directory.CreateDirectory(sFileName)
End If

'Succeeded in creating a folder
CreateFolder = True

Errors:

End Function
Jan 3 '06 #1
25 2525

It is recommended that classic VB6 error handling be replaced
with structured exception handling.

But to answer your specific question: In the code, no specific value
is returned in the (empty) error handler.

Just put a "CreateFolder = False" line after the "Errors:" label.

Note: You can also write "Return <value>" instead of
"<function name> = <value>".

/Joergen Bech

On Tue, 3 Jan 2006 08:30:06 -0800, guy <gu*@discussions.microsoft.com>
wrote:
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?

Private Function CreateFolder(ByVal sFileName As String) As Boolean

On Error GoTo Errors

'Create it if necessary
If Directory.Exists(sFileName) = False Then
Directory.CreateDirectory(sFileName)
End If

'Succeeded in creating a folder
CreateFolder = True

Errors:

End Function


Jan 3 '06 #2
I dont program in VB.NET - but not all paths return a value because falling
into error before you set createFolder=True would fail to provide a return
value, and you need to return a bool.

Put CreateFolder = False in your error section. Better still - start using
try/catch statements and get rid of the goto
--
Regards

John Timney
Microsoft MVP

"guy" <gu*@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?

Private Function CreateFolder(ByVal sFileName As String) As Boolean

On Error GoTo Errors

'Create it if necessary
If Directory.Exists(sFileName) = False Then
Directory.CreateDirectory(sFileName)
End If

'Succeeded in creating a folder
CreateFolder = True

Errors:

End Function

Jan 3 '06 #3
John Timney ( MVP ) wrote:
I dont program in VB.NET - but not all paths return a value because
falling into error before you set createFolder=True would fail to
provide a return value, and you need to return a bool.


I'm sure he realises that, the question was as to why he *didn't* get a
compiler warning. I would have expected there to be one too.

--

(O)enone
Jan 3 '06 #4
guy
this will definitely be rewritten, my point was the code as it stands does
NOT warn about a code path that does not return a value

"John Timney ( MVP )" wrote:
I dont program in VB.NET - but not all paths return a value because falling
into error before you set createFolder=True would fail to provide a return
value, and you need to return a bool.

Put CreateFolder = False in your error section. Better still - start using
try/catch statements and get rid of the goto
--
Regards

John Timney
Microsoft MVP

"guy" <gu*@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?

Private Function CreateFolder(ByVal sFileName As String) As Boolean

On Error GoTo Errors

'Create it if necessary
If Directory.Exists(sFileName) = False Then
Directory.CreateDirectory(sFileName)
End If

'Succeeded in creating a folder
CreateFolder = True

Errors:

End Function


Jan 3 '06 #5
"guy" <gu*@discussions.microsoft.com> schrieb:
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?

Private Function CreateFolder(ByVal sFileName As String) As Boolean

On Error GoTo Errors

'Create it if necessary
If Directory.Exists(sFileName) = False Then
Directory.CreateDirectory(sFileName)
End If

'Succeeded in creating a folder
CreateFolder = True

Errors:

End Function


To me it seems that they have forgotten to implement the check for 'On Error
GoTo'...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 3 '06 #6

Whoops. Misread the original post. .Net Reflector to the rescue.

This is what the code is turned into:

---snip---
Private Shared Function CreateFolder(ByVal sFileName As String) As
Boolean
Dim flag1 As Boolean
Dim num2 As Integer
Try
ProjectData.ClearProjectError
Dim num1 As Integer = 2
If Not Directory.Exists(sFileName) Then
Directory.CreateDirectory(sFileName)
End If
flag1 = True
goto Label_0066
Label_0025:
num2 = -1
Select Case num1
Case 0, 1
goto Label_005B
Case 2
goto Label_0066
End Select
Catch obj1 As Object When (?)
ProjectData.SetProjectError(CType(obj1, Exception))
goto Label_0025
End Try
Label_005B:
Throw ProjectData.CreateProjectError(-2146828237)
Label_0066:
If (num2 <> 0) Then
ProjectData.ClearProjectError
End If
Return flag1
End Function
---snip---

Dim flag1 As Boolean means that flag1 is implicitly initialized
to False by .Net.

So all code paths are indeed satisfied.

But it sure is ugly.

Regards,

Joergen Bech

On Tue, 3 Jan 2006 09:02:03 -0800, guy <gu*@discussions.microsoft.com>
wrote:
this will definitely be rewritten, my point was the code as it stands does
NOT warn about a code path that does not return a value

"John Timney ( MVP )" wrote:
I dont program in VB.NET - but not all paths return a value because falling
into error before you set createFolder=True would fail to provide a return
value, and you need to return a bool.

Put CreateFolder = False in your error section. Better still - start using
try/catch statements and get rid of the goto
--
Regards

John Timney
Microsoft MVP

"guy" <gu*@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
>i have inherited the following migrated vb6 code (vb2005)
> but i DONT get the "not all paths return a value" squiggly - is this a
> 'feature' of on error goto?
>
> Private Function CreateFolder(ByVal sFileName As String) As Boolean
>
> On Error GoTo Errors
>
> 'Create it if necessary
> If Directory.Exists(sFileName) = False Then
> Directory.CreateDirectory(sFileName)
> End If
>
> 'Succeeded in creating a folder
> CreateFolder = True
>
> Errors:
>
> End Function
>
>



Jan 3 '06 #7

well it does return a value cause it returns false
as a boolean datatype can`t be nothing or empty

:-)

so what is the point ??

M. Posseth [MCP]
"guy" <gu*@discussions.microsoft.com> schreef in bericht
news:7E**********************************@microsof t.com...
this will definitely be rewritten, my point was the code as it stands does
NOT warn about a code path that does not return a value

"John Timney ( MVP )" wrote:
I dont program in VB.NET - but not all paths return a value because
falling
into error before you set createFolder=True would fail to provide a
return
value, and you need to return a bool.

Put CreateFolder = False in your error section. Better still - start
using
try/catch statements and get rid of the goto
--
Regards

John Timney
Microsoft MVP

"guy" <gu*@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
>i have inherited the following migrated vb6 code (vb2005)
> but i DONT get the "not all paths return a value" squiggly - is this a
> 'feature' of on error goto?
>
> Private Function CreateFolder(ByVal sFileName As String) As Boolean
>
> On Error GoTo Errors
>
> 'Create it if necessary
> If Directory.Exists(sFileName) = False Then
> Directory.CreateDirectory(sFileName)
> End If
>
> 'Succeeded in creating a folder
> CreateFolder = True
>
> Errors:
>
> End Function
>
>


Jan 3 '06 #8
On Tue, 3 Jan 2006 18:31:58 +0100, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"guy" <gu*@discussions.microsoft.com> schrieb:
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?

Private Function CreateFolder(ByVal sFileName As String) As Boolean

On Error GoTo Errors

'Create it if necessary
If Directory.Exists(sFileName) = False Then
Directory.CreateDirectory(sFileName)
End If

'Succeeded in creating a folder
CreateFolder = True

Errors:

End Function


To me it seems that they have forgotten to implement the check for 'On Error
GoTo'...


As far as I understand it, the squiggly lines are not based on the
source text you see, but what the parser turns it into. Which in this
case is an entirely different beast. See my other post.

I see no bugs.

/JB

Jan 3 '06 #9

His point is that - on the surface - it does not *explicitly*
return a value.

/JB

On Tue, 3 Jan 2006 18:37:08 +0100, "m.posseth" <po*****@planet.nl>
wrote:

well it does return a value cause it returns false
as a boolean datatype can`t be nothing or empty

:-)

so what is the point ??

M. Posseth [MCP]
"guy" <gu*@discussions.microsoft.com> schreef in bericht
news:7E**********************************@microso ft.com...
this will definitely be rewritten, my point was the code as it stands does
NOT warn about a code path that does not return a value

"John Timney ( MVP )" wrote:
I dont program in VB.NET - but not all paths return a value because
falling
into error before you set createFolder=True would fail to provide a
return
value, and you need to return a bool.

Put CreateFolder = False in your error section. Better still - start
using
try/catch statements and get rid of the goto
--
Regards

John Timney
Microsoft MVP

"guy" <gu*@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
>i have inherited the following migrated vb6 code (vb2005)
> but i DONT get the "not all paths return a value" squiggly - is this a
> 'feature' of on error goto?
>
> Private Function CreateFolder(ByVal sFileName As String) As Boolean
>
> On Error GoTo Errors
>
> 'Create it if necessary
> If Directory.Exists(sFileName) = False Then
> Directory.CreateDirectory(sFileName)
> End If
>
> 'Succeeded in creating a folder
> CreateFolder = True
>
> Errors:
>
> End Function
>
>


Jan 3 '06 #10
Looks like a normal behavior as all paths are likely returning a value as
all paths are ending with end function (and the implicit return value is
false). IMO you have rather this warning when you use the "exit function"
statement ??

--
Patrice

"guy" <gu*@discussions.microsoft.com> a écrit dans le message de
news:5E**********************************@microsof t.com...
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?

Private Function CreateFolder(ByVal sFileName As String) As Boolean

On Error GoTo Errors

'Create it if necessary
If Directory.Exists(sFileName) = False Then
Directory.CreateDirectory(sFileName)
End If

'Succeeded in creating a folder
CreateFolder = True

Errors:

End Function

Jan 3 '06 #11
A value is still returned even if not explicit so Im' not sure the warning
would be fine here. Let's take the other way round. What kind of code would
create this warning ? (Exit Function ?)

--
Patrice

"Joergen Bech @ post1.tele.dk>" <jbech<NOSPAMNOSPAM> a écrit dans le message
de news:c1********************************@4ax.com...

His point is that - on the surface - it does not *explicitly*
return a value.

/JB

On Tue, 3 Jan 2006 18:37:08 +0100, "m.posseth" <po*****@planet.nl>
wrote:

well it does return a value cause it returns false
as a boolean datatype can`t be nothing or empty

:-)

so what is the point ??

M. Posseth [MCP]
"guy" <gu*@discussions.microsoft.com> schreef in bericht
news:7E**********************************@microso ft.com...
this will definitely be rewritten, my point was the code as it stands does NOT warn about a code path that does not return a value

"John Timney ( MVP )" wrote:

I dont program in VB.NET - but not all paths return a value because
falling
into error before you set createFolder=True would fail to provide a
return
value, and you need to return a bool.

Put CreateFolder = False in your error section. Better still - start
using
try/catch statements and get rid of the goto
--
Regards

John Timney
Microsoft MVP

"guy" <gu*@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
>i have inherited the following migrated vb6 code (vb2005)
> but i DONT get the "not all paths return a value" squiggly - is this a > 'feature' of on error goto?
>
> Private Function CreateFolder(ByVal sFileName As String) As Boolean >
> On Error GoTo Errors
>
> 'Create it if necessary
> If Directory.Exists(sFileName) = False Then
> Directory.CreateDirectory(sFileName)
> End If
>
> 'Succeeded in creating a folder
> CreateFolder = True
>
> Errors:
>
> End Function
>
>

Jan 3 '06 #12
"guy" <gu*@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com...
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?

Errors:

End Function


I've read a few of these answers that state something along the lines of:
Just put a "CreateFolder = False" line after the "Errors:" label.


That should never be required. Since False is the default return value for
any boolean function/variable/whatever, explicitly setting the return =
False should never be required. If it is suddenly required after 30 years of
programming, there should be a huge notice posted on the web somewhere that
says "forget about your existing source code, everything has suddenly
changed for no good reason"

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
Jan 3 '06 #13
"Joergen Bech @ post1.tele.dk>" <jbech<NOSPAMNOSPAM> schrieb:
To me it seems that they have forgotten to implement the check for 'On
Error
GoTo'...


As far as I understand it, the squiggly lines are not based on the
source text you see, but what the parser turns it into. Which in this
case is an entirely different beast. See my other post.


The occurance of the warning depends on the return type of the function. So
it's not actually a bug, but I believe the warning could have been
implemented in a way that it is also shown for functions which return a
value type.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 3 '06 #14
"Patrice" <no****@nowhere.com> schrieb:
Looks like a normal behavior as all paths are likely returning a value as
all paths are ending with end function (and the implicit return value is
false). IMO you have rather this warning when you use the "exit function"
statement ??


Consider this sample:

\\\
Public Function Foo() As Object
If True Then
Return "x"
End If
End Function
///

This function implicitly returns 'Nothing' on all code paths too if no
return value is set. So I do not think that this is a big difference to the
scenario the OP described, although the warning is shown for the code above.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 3 '06 #15
Ken,

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> schrieb:
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?

Errors:

End Function


I've read a few of these answers that state something along the lines of:
Just put a "CreateFolder = False" line after the "Errors:" label.


That should never be required. Since False is the default return value for
any boolean function/variable/whatever, explicitly setting the return =
False should never be required. If it is suddenly required after 30 years
of programming, there should be a huge notice posted on the web somewhere
that says "forget about your existing source code, everything has suddenly
changed for no good reason"


You could actually disable the warning. Simply open up the project file in
a text editor and add the warning number (42105) to the 'NoWarn' element.
My main concern is that the warning only occurs at functions which return a
reference type.

The full text of the warning makes this more clear: "[...] A null reference
exception could occur at run time when the result is used". I do not think
that implicitly returning 'Nothing' is a big problem. The main problem is
IMO forgetting to set a return value for a certain code path inside the
function. The same problem applies to BC42104 too. I have summed up my
thoughts on the usefulness of this warning in an article (in German):

Zur Sinnhaftigkeit der Compilerwarnung BC42104
<URL:http://dotnet.mvps.org/dotnet/articles/bc42104/>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 3 '06 #16
Sorry I don"t have 2005 hand. Even with a boolean return value ? What is the
code create for this ? I wonder what is the exact condition that triggres
this warning...

--
Patrice

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> a écrit dans le
message de news:eP**************@TK2MSFTNGP14.phx.gbl...
"Patrice" <no****@nowhere.com> schrieb:
Looks like a normal behavior as all paths are likely returning a value as all paths are ending with end function (and the implicit return value is
false). IMO you have rather this warning when you use the "exit function" statement ??
Consider this sample:

\\\
Public Function Foo() As Object
If True Then
Return "x"
End If
End Function
///

This function implicitly returns 'Nothing' on all code paths too if no
return value is set. So I do not think that this is a big difference to

the scenario the OP described, although the warning is shown for the code above.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 3 '06 #17
"Patrice" <no****@nowhere.com> schrieb:
Sorry I don"t have 2005 hand. Even with a boolean return value ? What is
the
code create for this ? I wonder what is the exact condition that triggres
this warning...


The warning will only work if the function's return type is a reference
type.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 3 '06 #18
Thanks for the follow up...

--
Patrice

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> a écrit dans le
message de news:e$*************@tk2msftngp13.phx.gbl...
"Patrice" <no****@nowhere.com> schrieb:
Sorry I don"t have 2005 hand. Even with a boolean return value ? What is
the
code create for this ? I wonder what is the exact condition that triggres this warning...


The warning will only work if the function's return type is a reference
type.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 3 '06 #19
On Tue, 3 Jan 2006 19:21:52 +0100, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"Joergen Bech @ post1.tele.dk>" <jbech<NOSPAMNOSPAM> schrieb:
To me it seems that they have forgotten to implement the check for 'On
Error
GoTo'...


As far as I understand it, the squiggly lines are not based on the
source text you see, but what the parser turns it into. Which in this
case is an entirely different beast. See my other post.


The occurance of the warning depends on the return type of the function. So
it's not actually a bug, but I believe the warning could have been
implemented in a way that it is also shown for functions which return a
value type.


Care to give me an example that involves On Error Goto?

It is true that the squiggly lines appear for

Public Function ObjectDoesProduceSquiggleLines() As Object
'Do nothing
End Function

but not for

Public Function ValueProducesNoSquiggleLines() As Boolean
Dim b As Boolean = True
End Function

But when the "On Error ..." abomination is used, as in the sample
the original poster provided ...

Check the samples below. None of them produce squiggly lines, even
though I am fairly positive that they cover both objects and value
types as return values. I see no difference in behavior due to
the choice of return types.

If you look at what the compiler turns the samples into, you will
see that something is explicitly returned on all code paths in all
samples.

---snip---
Option Explicit On
Option Strict On
....
Public Function GetString() As String
On Error GoTo someerror
Return ""
SomeError:
End Function

Public Function GetObject() As Object
On Error GoTo SomeError
Return Nothing
SomeError:
End Function

Public Function GetBoolean() As Boolean
On Error GoTo SomeError
Return False
SomeError:
End Function

Public Function GetArrayList() As ArrayList
On Error GoTo SomeError
Return New ArrayList
SomeError:
End Function
---snip---

Regards,

Joergen Bech

Jan 3 '06 #20

---snip---

I've read a few of these answers that state something along the lines of:
Just put a "CreateFolder = False" line after the "Errors:" label.


That should never be required. Since False is the default return value for
any boolean function/variable/whatever, explicitly setting the return =
False should never be required. If it is suddenly required after 30 years of

---snip---

Yes, I know. As I said in another post, I misread the original post.

Sorry.

/JB

Jan 3 '06 #21
"Joergen Bech @ post1.tele.dk>" <jbech<NOSPAMNOSPAM> schrieb:
To me it seems that they have forgotten to implement the check for 'On
Error
GoTo'...

As far as I understand it, the squiggly lines are not based on the
source text you see, but what the parser turns it into. Which in this
case is an entirely different beast. See my other post.
The occurance of the warning depends on the return type of the function.
So
it's not actually a bug, but I believe the warning could have been
implemented in a way that it is also shown for functions which return a
value type.


Care to give me an example that involves On Error Goto?


My bad. I finally didn't test it with 'On Error GoTo'.
But when the "On Error ..." abomination is used, as in the sample
the original poster provided ...

Check the samples below. None of them produce squiggly lines, even
though I am fairly positive that they cover both objects and value
types as return values. I see no difference in behavior due to
the choice of return types.
I believe the warning should at least be shown for those samples involving
reference types, regardless of whether or not they contain 'On Error GoTo'.
Interestingly the warning is shown for this snippet:

\\\
Public Function Foo() As Object
GoTo BailOut
Return 2
BailOut:
End Function
///
If you look at what the compiler turns the samples into, you will
see that something is explicitly returned on all code paths in all
samples.


In VB its granted that any function always returns a value on all code path,
but this is not necessarily done explicitly in the source code. So I don't
think that the decision whether or not to show the warning should be based
on the actual IL the compiler emits.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 3 '06 #22
>> see that something is explicitly returned on all code paths in all
samples.


In VB its granted that any function always returns a value on all code path,
but this is not necessarily done explicitly in the source code. So I don't
think that the decision whether or not to show the warning should be based
on the actual IL the compiler emits.


(last comment for tonight)

ok. I understand what you want.

But "On Error ..." is an abstraction that is turned into
something completely different (and much bigger).

I think what you are asking for would be extremely difficult
to implement - possibly basing the squiggly lines on something
different than what is being used by IntelliSense.

I am not qualified to speculate on how the
parser/compiler/IntelliSense
work their magic, so I'll leave this one alone.

/Joergen Bech

Jan 3 '06 #23
guy
Herfried, totally agree with your comments, i suppose what i was getting at
is that if you start relying on the warning you can be misled into thinking
you are returning a value when you are not exlpicitly doing it. i know
specifying a value type as the return value will always return a value, hut i
would have expected the warning when there is a code path that does not
***explicitly*** return a value.
seems to me this an 'intermittent' warning and can be misleading.

thanks guy

"Herfried K. Wagner [MVP]" wrote:
Ken,

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> schrieb:
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?

Errors:

End Function


I've read a few of these answers that state something along the lines of:
Just put a "CreateFolder = False" line after the "Errors:" label.


That should never be required. Since False is the default return value for
any boolean function/variable/whatever, explicitly setting the return =
False should never be required. If it is suddenly required after 30 years
of programming, there should be a huge notice posted on the web somewhere
that says "forget about your existing source code, everything has suddenly
changed for no good reason"


You could actually disable the warning. Simply open up the project file in
a text editor and add the warning number (42105) to the 'NoWarn' element.
My main concern is that the warning only occurs at functions which return a
reference type.

The full text of the warning makes this more clear: "[...] A null reference
exception could occur at run time when the result is used". I do not think
that implicitly returning 'Nothing' is a big problem. The main problem is
IMO forgetting to set a return value for a certain code path inside the
function. The same problem applies to BC42104 too. I have summed up my
thoughts on the usefulness of this warning in an article (in German):

Zur Sinnhaftigkeit der Compilerwarnung BC42104
<URL:http://dotnet.mvps.org/dotnet/articles/bc42104/>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 4 '06 #24
"guy" <gu*@discussions.microsoft.com> schrieb:
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?


Bug report:

<URL:http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?FeedbackId=e053a0fc-7d22-4c60-b596-a7b798a48100>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 4 '06 #25
guy
thanks Herfried

"Herfried K. Wagner [MVP]" wrote:
"guy" <gu*@discussions.microsoft.com> schrieb:
i have inherited the following migrated vb6 code (vb2005)
but i DONT get the "not all paths return a value" squiggly - is this a
'feature' of on error goto?


Bug report:

<URL:http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?FeedbackId=e053a0fc-7d22-4c60-b596-a7b798a48100>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 5 '06 #26

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bruce W.1 | last post by:
The intent of my web service is an RSS feed from a blog. Originally I used a StringBuilder to make the XML and returned a string from the webmethod. But this doesn't display properly in IE. So...
5
by: n_o_s_p_a__m | last post by:
Can't compile. Does this mean that all functions that throw exceptions must be of return type void? examples: // won't compile: "not all code paths return a value" public override int Run() {...
12
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
4
by: OutdoorGuy | last post by:
Greetings, I am attempting to compile the code below, but I am receiving an error message when I do so. The error message is: "CSO161: 'Forloop.CalcAvg(int)': Not all code paths return a...
3
by: Oberon | last post by:
How do I deal with this? I am getting an error for each get in the Game class (see code below). In the simplified example below I have reduced this to just 3 fields, one which can be NULL. I...
7
by: Robert | last post by:
I have the function below. it returns a "simpleresult" which I've also included the definition of below. In VS2005 (after upgrading the project), I get a warning indicating that Function...
1
by: UJ | last post by:
I am doing development on a machine and everything was working fine. The name of the project was ECS to I made all my references as ~/ECS/... Worked great. Put it on the final server running...
1
by: fretIT | last post by:
Hello, when I write web method using C# in Visual basic 2005, I can't return the string value to the client request. I got such kind of error Not all code paths return a value. Don't know how...
4
Markus
by: Markus | last post by:
I have a method that checks whether the passed argument is present in an array. The method needs to return a bool value. Take a look at said method: private bool IPExist(string IP) { ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.