Difference between revisions of "Write"

From Lazarus wiki
Jump to navigationJump to search
m (Review)
Line 1: Line 1:
 
{{Write}}
 
{{Write}}
  
write is a [[Keyword|keyword]] which indicates some characters to put on the screen
+
Write is a [[Keyword|keyword]] which indicates that some data must be written on the screen (by default).
for example
+
For example:
  
 
<syntaxhighlight>
 
<syntaxhighlight>
Line 8: Line 8:
 
   a, b: Integer;
 
   a, b: Integer;
 
begin
 
begin
   a:=42;
+
   a := 42;
   b:=23;
+
   b := 23;
   Write('a=', a, ' and b=', b);
+
   write('a=', a, ' and b=', b);
end
+
end</syntaxhighlight>
</syntaxhighlight>
 
  
prints `a=42 and b=23`
+
This prints on screen: ''a=42 and b=23''
  
 +
Parameters in the Write procedure must be separated by a comma (',').
  
Parameters must be separed by a [[,]].
+
WriteLn behaves just like Write, except it leaves (a) newline character(s) after the text.
 
 
WriteLn [[writeln]] behaves just like Write, except it leaves a newline character after the text.
 
  
 
[[Category:Pascal]]
 
[[Category:Pascal]]

Revision as of 05:04, 7 March 2015

Deutsch (de) English (en) español (es) русский (ru)

Write is a keyword which indicates that some data must be written on the screen (by default). For example:

var
  a, b: Integer;
begin
  a := 42;
  b := 23;
  write('a=', a, ' and b=', b);
end

This prints on screen: a=42 and b=23

Parameters in the Write procedure must be separated by a comma (',').

WriteLn behaves just like Write, except it leaves (a) newline character(s) after the text.