Results 1 to 3 of 3

Thread: New...... Some errors !

  1. #1
    Join Date
    Jan 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default New...... Some errors !

    Hey,

    I am new to scripting with SCAR, I have read some tutorials..... And I didn't understand a thing.
    Finally I found a great tutorial on how to use it. Just as I started to understand a couple of things I got an error.

    Line 15: [Error] (15:1): Identifier expected in script !

    So, because I have no idea of what I have done wrong I must ask for your help. Its a short simple code so it shouldn't take you more than a minute to tell me what is wrong.

    Here it is:
    SCAR Code:
    Program Test;

    Var
     i : integer;
     
    Procedure First; // Determines I
     begin
      i := 0
     end;
     
    Procedure Second; // Checks the value of I
     begin
      if (i = 0) then
       Writeln ('I equals 0');
        else
         Writeln ('I doesn''t equal 0');
     end;
     
    Begin
     First;
      Second;
    End.

    Some help would be greatly appreciated.

    Thanks.

    Fort Ash

  2. #2
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Fixed some of the standards:

    SCAR Code:
    Program Test;

    Var
     i : integer;

    Procedure First; // Determines I
    begin
      i := 0
    end;

    Procedure Second; // Checks the value of I
    begin
      if (i = 0) then
       Writeln ('I equals 0')
      else
        Writeln ('I doesn''t equal 0');
    end;

    Begin
     First;
     Second;
    End.

    The problem was this:

    SCAR Code:
    Writeln ('I equals 0');

    You don't want the semicolon before an Else.

    ~Sandstorm

  3. #3
    Join Date
    Jan 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey,

    Thanks a lot !
    It works great now!

    Fort Ash

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Errors.....
    By MrDeeds in forum OSR Help
    Replies: 3
    Last Post: 06-04-2007, 07:44 PM

Posting Permissions

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