SRL Archive - Research & Development Lounge

The significance of the error: Unknown identifier ''


m34tcode

2012-03-20 20:00:07

I'm assuming scripters have a hard time figuring out what some errors mean, when they occur in a script. Sometimes these error provide little to no debugging info. Here are some scenarios in which specific errors will occur.


Unknown identifier '' at line x
Known occurrences:
  • Creating a dynamic array of an invalid type(Ex. "Array of TPont" instead of "Array of TPoint")

Internal error (20) at line
Known occurrences:
  • Attempting to use the equality operator as an assignment operator(Ex. 'myInt = 10' instead of 'myInt := 10')

What causes these errors for you?

PatDuffy

2012-03-20 20:02:10

It basically just means that you messed up a parameter for a function/procedure on the line listed with the error.

To debug, double/triple check to make sure you filled out ALL the parameters with VALID variables/constants/etc.

RISK

2012-03-20 20:06:22

That or the variable you are attempting to use is not actually a variable that is declared in the script.

m34tcode

2012-03-20 20:13:45

@pat, you get the error when you mess up parameters? I can't seem to reproduce it that way. Could you post an example function that produces the error?

@RISK, that's the occurrence I ran into, although I am sure I have run into the problem in other places too. Didn't seem like that was the only cause.

RISK

2012-03-20 20:17:41

Example #1:
program new;

// Procedure caused

procedure CauseError();
begin
Unknown();
end;

procedure Unknown();
begin
end;

begin
CauseError();
end.


Example #2:
program new;

// Integer caused

procedure CauseError();
begin
WriteLn(ToStr(I));
end;

begin
CauseError();
end.

Sex

2012-03-20 20:27:36

Unknown Identifier means exactly what it says..lol.

m34tcode

2012-03-20 21:07:37

Risk, both of those produce errors similar to the one I posted about, but they say what the 'unknown identifier' is.

Try this:
var a : array of TPont;
begin
end.

it should output this:

[Error] (2:18): Unknown type 'TPont' at line 1
[Error] (2:18): Unknown identifier '' at line 1
Compiling failed.

@sex, try running the script I just posted. I dont think you quite understood what I meant ;]