That particular 'goto' does not create a well formed 'else' block. If you tried to make it an 'else', the code between it and the 'end-if' would not align.
By 'well-formed', I mean a block of code that immediately follows the end of the 'if' block it's associated with, and that ends at the same block level as the original 'if' statement. An 'else' block can't 'jump' levels. A 'goto' can.
You are talking about logic 42 (rm.ShipSternInterior). Here's the fully decompiled section that contains that 'goto' statement:
[ go fishing
if ((said("go", "fish") ||
said("go", "fishing") ||
said("fish") ||
said("acquire", "fish") ||
said("catch", "fish")))
{
[ Jerrod has to be on the aft deck
if (posn(ego, 40, 30, 65, 52))
{
[ if already fishing
if (isset(fFishing))
{
print("You are already fishing.");
goto(Done);
}
[ if sick
if (isset(SickAtSea))
{
[ too weak to fish
print("That is a wonderful idea, but you just can't muster the strength "
"to do it!");
}
else
{
[ check for all the required pieces needed to fish
[ paperclip for a hook
if (PaperclipStatus != 1)
{
print("This is the place to fish, but how can you fish without "
"something to use as a hook?");
goto(Continue);
}
[ string for line
if (StringStatus != 1)
{
print("This is the place to fish, but you are going to need some "
"fishing line!");
goto(Continue);
}
[ metal for weights
if (MetalStatus != 1)
{
print("This is the place to fish, but you need some weight to attach to "
"the fishing line!");
goto(Continue);
}
[ ham for bait
if (!isset(HasHam))
{
print("This is the place to fish, but the fish are going to want to see "
"some bait at the end of that line!");
goto(Continue);
}
[ shovel handle for pole
if (HandleStatus != 1)
{
print("This is the place to fish, all you need now is something to use "
"as a fishing pole!");
goto(Continue);
}
[ ready to go fishing!
print("Well you've done it!");
print("You have found the perfect place to fish, and you have everything "
"you need to do it!");
[ move into position on the stern deck
move.obj(ego, 56, 52, 1, fFishMoved);
[ initiate fishing status
vFishingStatus = 1;
[ score 8 points
if (!isset(ScoreFishing))
{
sound(s.AddToScore, fSoundDone);
set(ScoreFishing);
currentScore += 8;
}
}
}
else
{
print("You're getting close to the ideal fishing spot, but you're not quite "
"there!");
}
}
Continue:
.
.
.
.
Done:
[ call the main timing logic
call(lgc.CapeTripTiming);
return();
You will notice that the 'goto' statement jumps past the end of the if-block that it is inside of. So it can't be an 'else'. To reduce it to a simpler set of lines that are easier to see, this is what is happening:
if (testA)
{
if (testB)
{
statement1;
goto(Label1);
} [endif testB
statement2;
} [ endif testA
Label1:
statement3;
If you try to make that an 'else' block, you would get this:
if (testA)
{
if (testB)
{
statement1;
} else
{
******
* statement2;
* } [ endif testA
******
} [ endif testB
statement3;
You can see how the block levels don't work. The testA block can't end inside the testB block. Blocks have to be fully nested.
For a more technical definition of 'else' vs. 'goto' in terms of actual code, you could take a look at the WinAGI source, in the 'LogDecode.bas' module. Basically, decompiling is a two-pass process. The first time through, all jump points (labels), code blocks and their levels are determined, and stored in an array. Then the decompiler goes through the logic code a second time, identifying all commands and if tests. Using the information gathered during the first pass, labels are added as needed, and blocks are confirmed to be either 'else' or 'goto' depending on where they jump to.
WinAGI may not be authoritative, but it's pretty damn smart, and has a very good pedigree. It's based on original code from Peter Kelly's first AGI Studio. His decompiler code was pretty good, and since I did not know much about AGI at the time, I just copied what he had, porting it to VB but mostly following the same approach. I've made a few tweaks to it over the years, but the basic decompilation algorithm is pretty much the same as Peter's original.
And size doesn't matter (yeah, that's what she said...). Unless it's larger than an Integer. Then it would be a Long, and clearly, that would matter.