Results 1 to 9 of 9

Thread: Unknown Identifier

  1. #1
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Unknown Identifier

    SCAR will not call this procedure even though I am using the include statements at the top of the script.

    Note: This is to be my first script.
    Last edited by Diddy Kong; 02-20-2010 at 05:49 PM.

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

    Default

    It would really help if you posted the script .
    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"

  3. #3
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Unknown Identifier is an error quite frequently given when you forget to declare a Variable, or don't include a function your attempting to use.

    However, like Sex said, post the script and we can tell you normally exactly what's wrong with it.

  4. #4
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry for deleting the attachment you guys (Sorry I wasted your time! )

    Well, here is the attachment. I may not be working on this project for much longer.
    I don't know if this script will be any good.
    Last edited by Diddy Kong; 02-20-2010 at 05:51 PM.

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

    Default

    Have you programmed in Java before ?
    It is because you have $ in the include names. It is an invalid character so just rename all the includes and it will work fine .
    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"

  6. #6
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm still getting unknown identifiers. I guess it's not possible to make a huge script into multiples for simplicity/readability?

    I thought of the include statement as exactly what it says; I thought it would put that chunk of code from one scar file into another, and ultimately in the end compile that 'one huge script'.
    Last edited by Diddy Kong; 02-20-2010 at 06:11 PM.

  7. #7
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Why not just combine them all into one? Who cares how long the script it, maybe that will fix the problem too. I'm stumped on why its happening:/.

  8. #8
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by GreenText View Post
    I'm still getting unknown identifiers. I guess it's not possible to make a huge script into multiples for simplicity/readability?

    I thought of the include statement as exactly what it says; I thought it would put that chunk of code from one scar file into another, and ultimately in the end compile that 'one huge script'.
    I've never worked with making my own includes, but what Sex said seems to work. After removing all of the $ (from both the script names and when you include them in another script), you get

    Line 23: [Error] (31:5): Unknown identifier 'ComboBox1' in script C:\Program Files\SCAR\includes\RiverWranglerFormsCallbacks.sc ar
    You do not have a ComboBox1 (or any other of the variables used in the Start function) in that particular include nor does that include make use of other includes, meaning it cannot compile without knowing what ComboBox1 is.

    Same goes for your other include with forms: RiverWranglerFormsSplash. You cannot set the variable to a bitmap because SCAR does not know where that variable came from.

    And then, you're trying to set variables (such as the boolean Bank which is declared in your actual script) in the include. As far as I know, you cannot do that. To me, it seems that the easiest and best solution would be to merge these into one script. OR you can change your include's functions to return values instead of set values, though, if this is your first script, you might want to start off simpler (using one big script)

    EDIT: If you really want to continue with this, what I mean by return is using a function that returns the value you're looking for.

    Instead of this:

    SCAR Code:
    procedure InitSplashBitmap;
    begin
      bmpSplash := [superlongbitmap];
    end;

    Do

    SCAR Code:
    function InitSplashBitmap: integer;
    begin
      result := [superlongbitmap];
    end;

    So if you want to set a variable to the bitmap you have there

    SCAR Code:
    bmpsplash := InitSplashBitmap;

    If you need to set several things, do this

    SCAR Code:
    procedure ChangeValues(var Bank: boolean; var AmtFish: integer);
    begin
      Bank := true;
      AmtFish := 5;
    end;

    That will also change the values of the variables that you put in when calling the function. So if you do

    SCAR Code:
    DoBank := false;
    HowManyFish := 0;
    ChangeValues(DoBank, AmtFish);
    writeln(booltostr(DoBank)+' '+inttostr(AmtFish));

    The output will be

    true 5


    Correct me if I'm wrong on any of this, haven't scripted Scar in a while
    Last edited by Runescapian321; 02-20-2010 at 08:25 PM.

  9. #9
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Why not just combine them all into one? Who cares how long the script it, maybe that will fix the problem too. I'm stumped on why its happening:/.
    I made multiple files so it would be easier on me to develop the whole script.

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
  •