why skip read in for loop lazarus / 61-Beginners ---------------------------------------------------------------------- NoReason · 2017-11-28 01:25 program Project1; {$mode objfpc}{$H+} uses   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF}   Classes   { you can add units after this };   var     a:string;     b1:string;     b:array [1..100] of string;     i,c:integer; begin   writeln('Upisi ime programa');   read(a);   writeln('koliko reci posle imena programa zelis da imas?');   read(c);   for i:=1 to c do   begin     writeln('Upisi ',i,' rec');     read(b[i ]); (this)     end;   writeln;   writeln('Ime programa je:',a);   writeln;   writeln('Niz reci posle imena programa su:');   for i:=1 to c do   begin     writeln(b[i ]);   end;    read(c); end. ---------------------------------------------------------------------- jamie · 2017-11-28 03:09 For strings "READ" will return immediately if there are no Keys in the keyboard buffer or,  it will return with only what was in the buffer before you called "READ" "ReadLn" will wait for you to enter some data. ---------------------------------------------------------------------- NoReason · 2017-11-28 06:26 Thanks, but got another problem... How to compare 2 strings by ASCII? CompareText or CompareStr wont work :/ ---------------------------------------------------------------------- taazz · 2017-11-28 07:04 Quote from: NoReason on November 28, 2017, 07:26:18 amThanks, but got another problem... How to compare 2 strings by ASCII? CompareText or CompareStr wont work :/ They work as expected. At least I get proper results out of them provide a small sample which demonstrate your problem. Quote from: jamie on November 28, 2017, 04:09:24 amFor strings "READ" will return immediately if there are no Keys in the keyboard buffer or,  it will return with only what was in the buffer before you called "READ" "ReadLn" will wait for you to enter some data. No sorry its the other way around. read will pause the program execution until there is something to read from the keyboard buffer. ---------------------------------------------------------------------- NoReason · 2017-11-28 14:39 When i Use Comparetext got "project1.lpr(37,6) Error: Identifier not found "CompareText" But i found that i can write too like a>b (both strings) and this will give me true or not, so its practically same. ---------------------------------------------------------------------- Handoko · 2017-11-28 14:44 If I'm not wrong, you need to put sysutils in your uses clause if you want to use CompareText. https://www.freepascal.org/docs-html/rtl/sysutils/comparetext.html