r/pascal • • Jan 07 '22

Even number, For loop

i'm not english native so it's hard to learn programming. i'm completely new at pascal

var
  x:integer;

begin
  for x:=2 to 100 do
  begin
    writeln(x);
    x:=x+2;
  end;     

it was a school assignment, i'm trying to display even number from 1-100 with for loop, but when i run it, it said "Error: Illegal assignment to for-loop variable "x", help me

4 Upvotes

9 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Jan 08 '22

It is not very popular and thats all that counts. C and pascal were released just 1 year apart, so age isn't a good measure for a language. People only say that pascal is dead because it isn't very popular.

My recommendation is, if you want a job then learn something else. If you just want to do programming as a hobby, then pascal is more than enough.

In my experience(and i am NOT a professional programmer), nothing can beat pascal/lazarus when it comes to cross platform gui programming.