Hi again.
At compiling time, the previous application generates the error:
C:UsersGeorgeDocumentsVisual Studio 2015ProjectsXSharpApp1Form1 Methods.prg(68,2): warning XS0162: Unreachable code detected
at the RETURN statement (end of METHOD Listen_EntryPoint).
When I remove the RETURN statement, it compiles the project without errors.
I am attaching here a project showing the issue.
thanks and regards
George
XS0162: Unreachable code detected
XS0162: Unreachable code detected
George,
EDIT: as Chris said.
(sorry, didn't really "read" the output, time to shut down eyes & computer
fetched your code, doubleclicked the solution, VS2015 Community Edition loaded, "Build" - some seconds, "1 succeeded 0 fails". Looked for the Listen meth, "Return" is there. ??
EDIT: as Chris said.
(sorry, didn't really "read" the output, time to shut down eyes & computer
fetched your code, doubleclicked the solution, VS2015 Community Edition loaded, "Build" - some seconds, "1 succeeded 0 fails". Looked for the Listen meth, "Return" is there. ??
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
XS0162: Unreachable code detected
Hi George,
I think this is a correct warning, isn't it? In the code there is a DO WHILE TRUE without an EXIT statement, so execution will never go out of this loop, and any code after it will not execute, thus the warning.
Chris
I think this is a correct warning, isn't it? In the code there is a DO WHILE TRUE without an EXIT statement, so execution will never go out of this loop, and any code after it will not execute, thus the warning.
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
XS0162: Unreachable code detected
Chris,
>I think this is a correct warning, isn't it? In the code there is a DO WHILE TRUE without an EXIT statement, so execution will never go out of this loop, and any code after it will not execute, thus the warning.
That's true: Putting a conditional EXIT or RETURN inside the LOOP, it compiles.
But, the loop must be always present to listen into the System.Threading.Tasks.Task created by CreateParallelSocketServerTask Method.
And finally, calling the:
SELF:oSocketServer:Close()
at program's exit, the Task will be terminated. Right ?
regards
George
>I think this is a correct warning, isn't it? In the code there is a DO WHILE TRUE without an EXIT statement, so execution will never go out of this loop, and any code after it will not execute, thus the warning.
That's true: Putting a conditional EXIT or RETURN inside the LOOP, it compiles.
But, the loop must be always present to listen into the System.Threading.Tasks.Task created by CreateParallelSocketServerTask Method.
And finally, calling the:
SELF:oSocketServer:Close()
at program's exit, the Task will be terminated. Right ?
regards
George
XS0162: Unreachable code detected
Hi Karl,
when you compiled (with X# of course) didn't you see the warning for the line:
68 (Form1 Methods.prg) ?
I am using the beta 0.9.
regards
George
when you compiled (with X# of course) didn't you see the warning for the line:
68 (Form1 Methods.prg) ?
I am using the beta 0.9.
regards
George
XS0162: Unreachable code detected
Hi George,
I'd assume that indeed this will terminate it, but on the other hand I don't have experience on socket programming, so better not take my assumption for a fact!
Maybe someone with experience in the area can help..
Chris
I'd assume that indeed this will terminate it, but on the other hand I don't have experience on socket programming, so better not take my assumption for a fact!
Maybe someone with experience in the area can help..
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu