Free Pascal Lazarus Program Tutorial 4 - User Input


Readln and Read are used to collect data from user input. A variable with the correct data type must be used. The command readln (or its variation read) will collect the data. A variable with the data type must be declared to store the information. Writeln (or its variation write) will be used to display the information collected by the computer.

Example
var
name:string;

write('Enter Name: ');
readln(name);

The computer will collect the data from the user and this line will output the data to the screen.

writeln('Nice To Meet You, ', name);

Code Download
FPProgT4.zip