Results 1 to 7 of 7

Thread: The significance of the error: Unknown identifier ''

  1. #1
    Join Date
    Dec 2011
    Posts
    733
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default The significance of specific errors in Simba

    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?
    Last edited by m34tcode; 03-21-2012 at 12:31 AM.

  2. #2
    Join Date
    Feb 2011
    Location
    Earth
    Posts
    1,784
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    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.

    Currently: Working on Defending&Attacking in my Castle-Wars Script
    Project Rebuild: 90M/170M

  3. #3
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    That or the variable you are attempting to use is not actually a variable that is declared in the script.
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

  4. #4
    Join Date
    Dec 2011
    Posts
    733
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    @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.

  5. #5
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Example #1:
    Simba Code:
    program new;

    // Procedure caused

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

    procedure Unknown();
    begin
    end;

    begin
      CauseError();
    end.


    Example #2:
    Simba Code:
    program new;

    // Integer caused

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

    begin
      CauseError();
    end.
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

  6. #6
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Unknown Identifier means exactly what it says..lol.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  7. #7
    Join Date
    Dec 2011
    Posts
    733
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

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

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

    it should output this:
    Simba Code:
    [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 ;]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •