Pascal · lesson 2 of 30 · First stepsWrite in columns
Write prints and stays on the line; WriteLn ends it. A number after a colon sets the least width of a column.
02-write.pas Download 02-write.pas
program WriteText;
{ A comment is between braces. The compiler skips it. }
begin
Write('One ');
Write('line');
WriteLn;
WriteLn('It''s a quote inside text');
WriteLn('Disk':8, 'TB':6);
WriteLn('A':8, 8:6);
WriteLn('B':8, 12:6);
end.
Terminal
$ ./02-write
One line
It's a quote inside text
Disk TB
A 8
B 12Exercise
Add a third volume to the table.