Results 1 to 6 of 6

Thread: Unknown identifier 'WriteIn'

  1. #1
    Join Date
    May 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Arrow Unknown identifier 'WriteIn'

    I was following Coh3n's guide on simba scripting, and when I typed it in for practice just as he did, id get this error;

    Unknown identifier 'WriteIn'

    And when I copied/pasted it, it compiled fine.
    I proofread for any errors and could not find anything.

    Simba Code:
    program PuttingTogetherBasics;


    var
      Logs: Integer;
      Exp: Extended;

    const
      NUMBER_OF_LOGS = 500;
      TREE_TO_CUT    = 'Magic';

    procedure  HowManyLogs;
    begin
      Logs := 250;
      Exp := 195.5;

      WriteIn('We have chopped' + IntTostr(logs) +'logs this seesion!';
      Wait(500);
      WriteIn('We want to chop' + IntToStr(NUMBER_OF_LOGS) +'logs';
      Wait(500);
      WriteIn('We are chopping' + TREE_TO_CUT +'trees!');
      Wait(500);
      WriteIn('We have gained' + FloatToStr(Logs * Exp)+'xp this seesion!;);
    end;

    function WeAreBored: string;
    var
      s:String;
    begin
      Result:='
    What are we going to do now?'
      s:='
    We are very bored chopping all these logs!;
      Wait(500);
      WriteIn(s);
    end;

    begin
      ClearDebug;
      HowManyLogs;
      WriteIn(WeAreBored);
    end.


    And here was the normal one from Coh3n:


    Simba Code:
    program PuttingTogetherBasics;

    // Declareing variables globally
    var
      Logs: Integer;
      Exp: Extended;

    // Declareing constants
    const
      NUMBER_OF_LOGS = 500;      // Notice the integer
      TREE_TO_CUT    = 'Magic';  // Notice the string

    // Using a procedure
    procedure HowManyLogs;
    begin
      // This is how we ASSIGN a type to a variable; Remember this ;)
      Logs := 250; // Notice we can use the variable "Logs" because it's declared globally
      Exp := 195.5;

      Writeln('We have chopped ' + IntToStr(Logs) + ' logs this session!'); // Notice the '+', this is required if you are going to Writeln a constant or variable
      Wait(500); // This is new, but don't worry; this is a simple procedure that waits the given time in milliseconds (1000ms = 1s)
      Writeln('We want to chop ' + IntToStr(NUMBER_OF_LOGS) + ' logs.');
      Wait(500);
      Writeln('We are chopping ' + TREE_TO_CUT + ' trees!');
      Wait(500);
      Writeln('We have gained ' + FloatToStr(Logs * Exp) + ' xp this session!');
      //FloatToStr is used to convert extended values to strings; it works the same as IntToStr
    end;

    // Using a function
    function WeAreBored: string;
    var // Declareing variables locally
      s: String;
    begin
      Result := 'What are we going to do now?'; // Notice that "Result" is a string because the function returns a string
      s := 'We are very bored chopping all these logs!';
      Wait(500);
      Writeln(s); // Notice no "IntToStr" because the variable "s" is already a string
    end;

    begin // Don't forget to put your procedures/functions in the main loop!
      ClearDebug; // This procedure just clears the debug box when you click run
      HowManyLogs;
      Writeln(WeAreBored); // Since WeAreBored returns a string and Writeln() takes a string as its parameters, the function itself can be called
    end. //Notice the '.', signalling the end of the script

    Any help is appreciated.
    -Kobalt

  2. #2
    Join Date
    May 2007
    Location
    England
    Posts
    4,141
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    It's WriteLn, with an L, not I.

    Also
    Simba Code:
    WriteIn('We have chopped' + IntTostr(logs) +'logs this seesion!';
      Wait(500);
      WriteIn('We want to chop' + IntToStr(NUMBER_OF_LOGS) +'logs');
      Wait(500);
      WriteIn('We are chopping' + TREE_TO_CUT +'trees!');
      Wait(500);
      WriteIn('We have gained' + FloatToStr(Logs * Exp)+'xp this seesion!;);
    end;
    Should be
    Simba Code:
    WriteLn('We have chopped' + IntTostr(logs) + ' logs this session!';
      Wait(500);
      WriteLn('We want to chop' + IntToStr(NUMBER_OF_LOGS) + 'logs');
      Wait(500);
      WriteLn('We are chopping' + TREE_TO_CUT + ' trees!');
      Wait(500);
      WriteLn('We have gained' + FloatToStr(Logs * Exp) + 'xp this session!');
    end;
    The extra spacing doesn't matter; it just makes it easier to read.
    Last edited by Rich; 05-07-2011 at 05:00 PM.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  3. #3
    Join Date
    May 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hahah...
    Thanks rich

  4. #4
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Here is the fixed one. Just little mistakes and typos (Remember It's Writeln not WriteIn)
    And some other mistakes too.
    Compare it to your original.
    Too lazy to make big thread about errors.
    Sorry

    Simba Code:
    program PuttingTogetherBasics;


    var
      Logs: Integer;
      Exp: Extended;

    const
      NUMBER_OF_LOGS = 500;
      TREE_TO_CUT    = 'Magic';

    procedure  HowManyLogs;
    begin
      Logs := 250;
      Exp := 195.5;

      Writeln('We have chopped' + IntTostr(logs) +'logs this seesion!');
      Wait(500);
      Writeln('We want to chop' + IntToStr(NUMBER_OF_LOGS) +'logs');
      Wait(500);
      Writeln('We are chopping' + TREE_TO_CUT +'trees!');
      Wait(500);
      Writeln('We have gained' + FloatToStr(Logs * Exp)+'xp this seesion!');
    end;

    function WeAreBored: string;
    var
      s:String;
    begin
      Result:='What are we going to do now?'
      s:= 'We are very bored chopping all these logs!';
      Wait(500);
      Writeln(s);
    end;

    begin
      ClearDebug;
      HowManyLogs;
      Writeln(WeAreBored);
    end.

    ~Home

  5. #5
    Join Date
    May 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks!

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

    Default

    Also, try changing the report a bit.
    Writeln('We have chopped' + IntTostr(logs) +'logs this seesion!');
    Wait(500);
    Writeln('We want to chop ' + IntToStr(NUMBER_OF_LOGS) + ' logs');
    Wait(500);
    Writeln('We are chopping ' + TREE_TO_CUT + 'trees!');
    Wait(500);
    Writeln('We have gained' + FloatToStr(Logs * Exp) + 'xp this session!');
    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"

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
  •