Re: Exit Sub in C#

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Wed, 24 May 2006 08:14:10 -0700, "Tina"
<tinamseaburn@xxxxxxxxxxxxxxxxxx> wrote:

Wow, I guess I started a religious "return debate". Actually return; was
the first thing I tried
but the compiler flagged it. I find that in C# the compiler will
occasionally flag something as an
error that is not an error. But then when something else is changed, that
is seemingly unrelated, the
flag goes away. This has happend four or five times.

The flag on the return; (the only error left) went away when I tightened up
some white space.

VB never did that.

thanks,


Hi Tina

I think the first thing you should do is forget about what vb does or
doesn't do. C# is a different language and the editor for each
language behave differently to each other.

Each language evolved from a different idea of how a language should
be implemented. They now use the same framework as you know but that
is a relatively recent development. I doubt you find irritation in
the differences between vb and cpp for instance, you expect there to
be. So it's the same with c#.

Whenever I code I get errors occurring that seem unrelated to the
actual problem itself.

eg

class test1
{

abc

public void Func()
{
// do stuff
}

}

an error will be flagged on public because the previous line is
invalid for several reasons.

if I add a ; to the end

abc;

the error moves to the ; telling me I have an invalid token. Obviously
the line terminator isn't an invalid token so the error is somewhere
else. Then changing the declaration to.

private int abc;

fixes the error.

One thing I've learnt is that when there is an error, no matter how
much I think it is with the tool I'm using or language I'm writing in,
99.9% of the time the mistake is mine and I probably need to check
what I've done or do a little more research so I'm more familiar with
the tools I'm using.

cheers

Steve

http://pretty-vacant.co.uk
.



Relevant Pages

  • Re: Simple Ajax question.
    ... Are you saying that the clocks do not work for you? ... English has been pushed to the start in order to reduce the ... language code, and put English in it's proper place between Greek ... it makes more sense to use the American flag. ...
    (comp.lang.javascript)
  • Re: RfD -- FVALUE vsn 2.0
    ... the ' could fail to find the name and throw a system exception. ... need to clear the flag, as does start up, QUIT and what else? ... language at the other, ... theory permit strongly checking implementations that will warn the ...
    (comp.lang.forth)
  • Re: Simple Ajax question.
    ... They are in alphabetic order of the drop-down list on the Google ... English has been pushed to the start in order to reduce the ... language code, and put English in it's proper place between Greek ... it makes more sense to use the American flag. ...
    (comp.lang.javascript)
  • Re: Last event
    ... Than take care that all intitialisation is done before the events are set. ... This depends really how to do on the language you are using and than it is ... I think the flag ...
    (microsoft.public.dotnet.general)
  • Re: OT: British pulled Australian tourism ad over swearword
    ... Have you ever gone to the ABC site and did a search for the word ... downright foul language. ... language can be pinned down. ... So the topic in the Jorn Utzon Room of the Sydney Opera House was ...
    (misc.survivalism)