Lazarus

Free Pascal => Beginners => Topic started by: homojavanicus on December 01, 2019, 12:17:21 pm

Title: readln executed before writeln
Post by: homojavanicus on December 01, 2019, 12:17:21 pm
hi, i'm new in pascal, and generally new to the computer programming world. I'm in my way learning pascal. I was trying to write a goal tracker program, and my program runs seamlessly unless one thing. the readln function that on the lower line, executed before the writeln function that is wroten first. and it like the program ask input more than I expect(based how much readln function are) this problem( or behaviour) is quite annoying the input process. for better understanding this is my script:

{empty}
{sorry I don't know how to copy script from free pscal :-[

any help pleaaase...
Title: Re: readln executed before writeln
Post by: 440bx on December 01, 2019, 12:20:29 pm
Any chance you can post the code ?... it would make it a lot easier to help you.
Title: Re: readln executed before writeln
Post by: Bart on December 01, 2019, 12:33:41 pm
{sorry I don't know how to copy script from free pscal

Copy the code and just paste it between the [code] [/code] tags.
Example:
[code=pascal]
program foo;
begin
  writeln('foo');
end.
[/code]

It will show up like this
Code: Pascal  [Select]
  1. program foo;
  2. begin
  3.   writeln('foo');
  4. end.
  5.  

The "=pascal" part tells the forum software to use the highlighter for pascal.

Bart
Title: Re: readln executed before writeln
Post by: homojavanicus on December 01, 2019, 12:55:35 pm
okay I will do  it later. I have something to do now. thank you man!
Title: Re: readln executed before writeln
Post by: lucamar on December 01, 2019, 05:16:20 pm
{sorry I don't know how to copy script from free pscal :-[

Canonical advice page in the wiki for new users of the forum: Forum (https://wiki.freepascal.org/Forum) :)