SRL Archive - Bugs

Wrong Error Line


Sir R. M8gic1an

2010-09-06 04:09:46

This is Simba's most annoying bug. Extremely often, when there is a compiling error it'll point you to the completely wrong line.

And I'm not talking about a missing end or something. I'm talking about invalid number of parameters >.>

~RM

Bebe

2010-09-06 04:10:59

Specific example + code please?

mastaraymond

2010-09-06 04:22:34

I know and it's freaking annoying.. However it's a bug in PS. I'll try to have a look at it one day.

(I think it has to do with includes)

Sir R. M8gic1an

2010-09-06 04:33:37

@bebe


writeln('this is a line');
wrilteln('this is line 2');
writeln('this is line 3');
writeln('this is line 4');
writeln('this is', 'line 5'); //wrong params

It would tell me something of the sort: Wrong params in line 2

The actual code is lost by now.

@Ray: But scar didn't use to have it this bad :s It's not like it's from one file to another, it gives the wrong line even within the same file :S

~RM

TomTuff

2010-09-06 04:49:56

i have an example of this, see the thread i just posted here:
http://villavu.com/forum/showthread.php?t=58826

Simba points me to line 1, so i guess i'll either have to go through and see where i messed up the paramaters or open the script in SCAR and see where it points me.

Nava2

2010-09-06 06:49:20

RM, wine?

Sir R. M8gic1an

2010-09-06 06:54:39

From: Nava2
RM, wine?


Uh >.< Does it all really come down to wine? I don't think wine can affect the feedback simba gives me, can it? :S

~RM

ZephyrsFury

2010-09-06 06:59:51

I get similar problems and I'm on Windows 7

Gu3st...

2010-09-06 09:38:51

Same with me, and I'm on Vista and Windows 7

Naum

2010-09-06 09:42:33

wrilteln is a new procedure I haven't heard of, try this:

Begin
writeln('this is a line');
writeln('this is line 2');
writeln('this is line 3');
writeln('this is line 4');
writeln('this is', 'line 5'); //wrong params
End.

anonymity

2010-09-06 11:18:10

^ sarcasm??????

I believe he was exampling an error.

good line 1
type line 2
good line 3
good line 4
param err 5

and simba says the param error is in line 2.. I think I got that right. And yes I get similar errors (win7 and xp).

3Garrett3

2010-09-06 14:00:35

From: 3Garrett3
I find it impossible to fix any errors with MSI, I have to port out the code into a new script without the headers.

Simba counts lines (visually) like this:

1. Program new;
2. begin
3. //dostuff;
4. *compile error here*
5.end;

But reports the problem (debug box + highlighting) as this:

1. Program new;
2. begin
3. *compile error here*
4.end;

So I would be looking on line 3 for the error, etc. When you get so many headers, as MSI functions have, it builds up and I could be looking 40 or 50 lines above what the actual error is. I find it really hard to figure out where the actual error is..



This is what I've found. Nothing has been done about it. AFIAK, SCAR accounted for the headers, while Simba does not. Code like this:

{******************************************************************************}
{ Function MSI_FishingTools : TIntegerArray }
{ By: 3Garrett3 }
{ Date: 25 July 2010 }
{ Description: Figures out which tool the script needs to use }
{******************************************************************************}
Function MSI_FishingTools : TIntegerArray;
var
script: TScript;
i: Integer;
begin
script := MSI_Scripts[MSI_Players[CurrentPlayer].Scripts[CurrentScript]];

for i := 0 to High(script.Objects) do
case (script.Objects[i]) of
FISHSPOT_NET:
Result := CombineIntArray(Result, [FISH_SMALLNET]);

FISHSPOT_BAIT:
Result := CombineIntArray(Result, [FISH_ROD, FISH_BAIT]);

FISHSPOT_LURE:
Result := CombineIntArray(Result, [FISH_FLY, FISH_FEATHER]);

FISHSPOT_CAGE:
Result := CombineIntArray(Result, [FISH_CAGE]);

FISHSPOT_HARPOON:
Result := CombineIntArray(Result, [FISH_HARPOON]);

else
MSI_Debug('Invalid Fishing Spot Argument');
end;

ClearSameIntegers(Result);
end;

{******************************************************************************}
{ Function MSI_DetectWaterDirections() : TBoolArray }
{ By: 3Garrett3 }
{ Date: 24 August 2010 }
{ Description: Finds the directions of water, helping find the fishing spot }
{******************************************************************************}
Function MSI_DetectWaterDirections(var Counts : TIntegerArray) : TBoolArray; // Array - 0 = right 1 = left 2 = below 3 = above
var
ATPA : T2DPointArray;
cts, i : Integer;
begin
SetLength(ATPA, 4);
SetLength(Result, 4);

cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.25, 0.25);

FindColorsTolerance(ATPA[0], 9602689, MSCx + 20 , MSCy - 10, MSCx + 40, MSCy + 10, 14); // To the right
FindColorsTolerance(ATPA[1], 9602689, MSCx - 40 , MSCy - 10, MSCx - 20, MSCy + 10, 14); // To the left
FindColorsTolerance(ATPA[2], 9602689, MSCx - 10 , MSCy + 30, MSCx + 10, MSCy + 50, 14); // below
FindColorsTolerance(ATPA[3], 9602689, MSCx - 10 , MSCy - 50, MSCx + 10, MSCy - 30, 14); // above

for i := 0 to 3 do
begin
Result[i] := (Length(ATPA[i]) > 200);
Counts[i] := Length(ATPA[i]);
MSI_Debug('DetectWaterDirections, direction: ' + ToStr(i) + '. Result: ' + ToStr(Result[i]) + '. WaterCount: ' + ToStr(Counts[i]));
end;

ColorToleranceSpeed(cts);
end;

Can really throw the errors off. This code would be off at least 10 lines, because there are 10 commented lines. I don't know if it accounts for blank space, but that would throw the lines off by even more. Something has to be done, this never used to happen..