• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

[HELP] goto statement compiler error?

buho

Privateer
Storm Modder
There is an error in the goto compiling.

Lets say we have this code:

Code:
if (SomeError)
{
DoSomething;
goto ErrorHandling;
}
//
//
//
ErrorHandling:   // <--------
//
//

If the code segment is loaded more than one time (like in a dialog, which is loaded every time yo click the NPC) the compiler produces "duplicated label" errors after the first time you load the code.

The code works as intended every time, but the compiler sends the messages to the error file.

The point is that while the behaviour is not a big concern itself, the error log is poluted enough: sending more error messages to it make things still more obscure, so it is better not to use "goto" at all.

Cheers.
buho (A).
 
Probably not.

First at all for what I know the sources can't be compiled or are very difficult to compile; they can be very useful to know how things work but probably nothing more.

Second we have not all the source code, only some parts: I doubt the script compiler sources being there.

Anyway, "goto" is very seldom used (there is not any "goto" but mine ones in all the sources), most programmers see it as "evil". And it is evil most of the time, no doubt.

Cheers.
buho (A).
 
OK,

So are you even going to attempt to fix this, or should we just leave it alone? Can the error logging be implemented some other way that wouldn't be too hard to do?

I agree with you. I remember writing hundred of goto lines in basic back in the 80's. We've come a long way since then from every other line being goto, to now with the odd, every now and then goto line

MK
 
Back
Top