Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8592065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:39:59+00:00 2026-06-11T23:39:59+00:00

I can’t understand what’s going on here. Can you give me a hand? This

  • 0

I can’t understand what’s going on here. Can you give me a hand? This is the problematic code:

While not EOF(Archi) do begin
  index:= index + 1;
  Read(Archi, Alumno[index]);
  Promes[index] := (Alumno[index].nota1 + Alumno[index].nota2) / 2;
  if Promes[index] >= 6 then begin
     alguPromo := true;
     PromosIndex := PromosIndex + 1;
     Promos[PromosIndex]:= Alumno[index];
  end;
  else begin
       if Promes[index] > 4 then cantiRecu:= cantiRecu + 1;
       else begin
            LibresIndex += 1;
            Libres[LibresIndex] := Alumno[index];
            end;
  end;
end;

The compiler marks error in the line 10 of this code (else begin). The error is:
Fatal: Syntax error, ; expected but ELSE found.

If someone wants to tray compile here is the entire code: http://pastebin.com/dRg1Lguu

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:40:00+00:00Added an answer on June 11, 2026 at 11:40 pm

    Note that in Pascal the semicolon is a separator, not a terminator. Sometimes this doesn’t matter, but in some cases it does, particularly before an else. Your code should be:

    while not EOF(Archi) do
      begin
        index:= index + 1;
        Read(Archi, Alumno[index]);
        Promes[index] := (Alumno[index].nota1 + Alumno[index].nota2) / 2;
        if Promes[index] >= 6 then
          begin
            alguPromo := true;
            PromosIndex := PromosIndex + 1;
            Promos[PromosIndex] := Alumno[index]
          end
        else
          begin
            if Promes[index] > 4 then
              cantiRecu:= cantiRecu + 1
            else
              begin
                LibresIndex := LibresIndex + 1;
                Libres[LibresIndex] := Alumno[index]
              end
          end
      end
    

    Note that I have re-formatted the code into a more conventional style which helps to make the program logic more easily understood and which also makes it more obvious where the semicolons are needed and where they are not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone maybe tell me why this is not working? I have used echo
Can not find scala.actors package in latest milestones, while it still presents in scaladocs:
Can we change the default action of the edit selected row button? Here is
Can someone thoroughly explain the last line of the following code: def myMethod(self): #
Can anyone explain to me why this program: for(float i = -1; i <
Can someone please explain to me why the output from the following code is
Can someone give me a clear, concise definition of the difference between a programming
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Can you help me to understand, words.Aggregate((workingSentence, next) => + next + + workingSentence);
Can anyone tell me the exact syntax for NOT IN condition in SQL on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.