Like Tree1Likes
  • 1 Post By anduril462

Parsing Error (Pascal) - A Level Student.

This is a discussion on Parsing Error (Pascal) - A Level Student. within the Tech Board forums, part of the Community Boards category; Hi guys; I know this is specific to C++ programming but I am new to the programming world, just beginning ...

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    3

    Parsing Error (Pascal) - A Level Student.

    Hi guys; I know this is specific to C++ programming but I am new to the programming world, just beginning to study in my A Levels so this shouldn't be a problem for you guys (we are learning currently in pascal but are starting C and Java net year)
    For my homework assignment I need to devise a 2Dimensional array to produce my timetable. I've looked at my script many times and can't clear the error I face on line "5/28 Timetable.pas
    Fatal: Syntax error, OF expected but [ found"
    I tried to trobleshoot this by making my "of" uppercase but no luck; below I have attached my script:
    Code:
    program Arrays;
    
         var
         //Array Variables\\
         myArray : Array [0..5][0..4] OF String;
         Counter : integer;
         //Lessons Variables\\
         C : Computing;
         I : ICT;
         P : Product Design;
         B : BTEC Business;
         F : Free Period;
         R : Registration;
    
    ///////////////Main Program\\\\\\\\\\\\\\\
    begin
    ///////////////Mondays Lessons\\\\\\\\\\\\\\\
                myArray[0][0]:='R';
                myArray[0][1]:='I';
                myArray[0][2]:='C';
                myArray[0][3]:='F';
                myArray[0][4]:='F';
                myArray[0][5]:='F';
    ///////////////Tuesdays Lessons\\\\\\\\\\\\\\\
                myArray[1][0]:='R';
                myArray[1][1]:='F';
                myArray[1][2]:='I';
                myArray[1][3]:='F';
                myArray[1][4]:='I';
                myArray[1][5]:='B';
    ///////////////Wednesdays Lessons\\\\\\\\\\\\\\\
                myArray[2][0]:='R';
                myArray[2][1]:='B';
                myArray[2][2]:='I';
                myArray[2][3]:='C';
                myArray[2][4]:='B';
                myArray[2][5]:='F';
    ///////////////Thursdays Lessons\\\\\\\\\\\\\\\
                myArray[3][0]:='R';
                myArray[3][1]:='B';
                myArray[3][2];='P';
                myArray[3][3];='F';
                myArray[3][4];='I';
                myArray[3][5];='C';
    ///////////////Fridays Lessons\\\\\\\\\\\\\\\
                myArray[4][0];='R';
                myArray[4][1];='P';
                myArray[4][2];='F';
                myArray[4][3]:='F';
                myArray[4][4]:='C';
                myArray[4][5]:='B';
    end.
    Any response would be much appreciated, hopefully we can get to the bottom of this ...

    Thanks in advance

    Alex

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    2,407
    what response do you expect? you've submitted something that is not C++ code on the C++ forum.

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    3
    yes I understand that; but I couldn't find where to submit other queries...I thought pascal had a syntax similar to all other languages and thought maybe I could get some direction of where to go; if you can't help me out no worries but would just be nice to fathom out where I've gone wrong!

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    Well finding a forum with "pascal" somewhere in the title, or listed as a sub-forum would be a good idea.
    In the meantime, thread moved.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Oct 2011
    Posts
    3
    Thanks Salem; Sorry I wont post here in future with if not concerning C/C++ questions, will look elsewhere...hope to revisit once I start working on C++
    Take care!!

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by AlexMK92 View Post
    yes I understand that; but I couldn't find where to submit other queries...I thought pascal had a syntax similar to all other languages and thought maybe I could get some direction of where to go; if you can't help me out no worries but would just be nice to fathom out where I've gone wrong!
    Pascal is conceptualy like other languages but syntacticaly very different...

    Been a while but I believe you want...
    Code:
    myArray : Array [0..5,0..4] Of String;

  7. #7
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,491
    Quote Originally Posted by AlexMK92 View Post
    Code:
                 myArray[0][0]:='R';
                myArray[0][1]:='I';
                myArray[0][2]:='C';
                myArray[0][3]:='F';
                myArray[0][4]:='F';
                myArray[0][5]:='F';
    ///////////////Tuesdays Lessons\\\\\\\\\\\\\\\
                myArray[1][0]:='R';
                myArray[1][1]:='F';
                myArray[1][2]:='I';
                myArray[1][3]:='F';
                myArray[1][4]:='I';
                myArray[1][5]:='B';
    ///////////////Wednesdays Lessons\\\\\\\\\\\\\\\
                myArray[2][0]:='R';
                myArray[2][1]:='B';
                myArray[2][2]:='I';
                myArray[2][3]:='C';
                myArray[2][4]:='B';
                myArray[2][5]:='F';
    ///////////////Thursdays Lessons\\\\\\\\\\\\\\\
                myArray[3][0]:='R';
                myArray[3][1]:='B';
                myArray[3][2];='P';
                myArray[3][3];='F';
                myArray[3][4];='I';
                myArray[3][5];='C';
    ///////////////Fridays Lessons\\\\\\\\\\\\\\\
                myArray[4][0];='R';
                myArray[4][1];='P';
                myArray[4][2];='F';
                myArray[4][3]:='F';
                myArray[4][4]:='C';
                myArray[4][5]:='B';
    Sesame Street - One Of These Things - YouTube

    Okay, so it's more than 1 thing, but still, you got some more fixing to do.
    GReaper likes this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Optimization Level 2 produces error
    By 0xa4 in forum C Programming
    Replies: 12
    Last Post: 12-03-2009, 10:32 AM
  2. String parsing(parsing comments out of HTML file)
    By slcjoey in forum C# Programming
    Replies: 0
    Last Post: 07-29-2006, 08:28 PM
  3. Parsing error?
    By emm in forum C++ Programming
    Replies: 10
    Last Post: 07-16-2006, 03:08 PM
  4. New Student Error Messages
    By LADYGRAFIX in forum C++ Programming
    Replies: 5
    Last Post: 02-22-2006, 06:43 PM
  5. Parsing error : HELP!
    By Frandy in forum Windows Programming
    Replies: 3
    Last Post: 03-10-2005, 12:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21