Difference between revisions of "Basic Pascal Tutorial/Chapter 2/Output"

From Lazarus wiki
Jump to navigationJump to search
m (Text replace - "delphi>" to "syntaxhighlight>")
m (Fixed syntax highlighting)
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Output}}
 +
{{TYNavigator|Input|Formatting_output}}
 +
 
2B - Output (author: Tao Yue, state: unchanged)
 
2B - Output (author: Tao Yue, state: unchanged)
  
 
For writing data to the screen, there are also two statements, one of which you've seen already in last chapter's programming assignment:
 
For writing data to the screen, there are also two statements, one of which you've seen already in last chapter's programming assignment:
<syntaxhighlight>
+
 
 +
<syntaxhighlight lang=pascal>
 
write (Argument_List);
 
write (Argument_List);
 
writeln (Argument_List);
 
writeln (Argument_List);
Line 11: Line 15:
 
You can use strings in the argument list, either constants or literal values. If you want to display an apostrophe within a string, use two consecutive apostrophes. Displaying two consecutive apostrophes would then requires you to use four. This use of a special sequence to refer to a special character is called escaping, and allows you to refer to any character even if there is no key for it on the keyboard.
 
You can use strings in the argument list, either constants or literal values. If you want to display an apostrophe within a string, use two consecutive apostrophes. Displaying two consecutive apostrophes would then requires you to use four. This use of a special sequence to refer to a special character is called escaping, and allows you to refer to any character even if there is no key for it on the keyboard.
  
{|style=color-backgroud="white" cellspacing="20"
+
{{TYNavigator|Input|Formatting_output}}
|[[Input|previous]] 
 
|[[Contents|contents]]
 
|[[Formatting_output|next]]
 
|}
 

Revision as of 05:43, 23 February 2020

български (bg) Deutsch (de) English (en) français (fr) 日本語 (ja) русский (ru) 中文(中国大陆)‎ (zh_CN)

 ◄   ▲   ► 

2B - Output (author: Tao Yue, state: unchanged)

For writing data to the screen, there are also two statements, one of which you've seen already in last chapter's programming assignment:

write (Argument_List);
writeln (Argument_List);

The writeln statement skips to the next line when done.

You can use strings in the argument list, either constants or literal values. If you want to display an apostrophe within a string, use two consecutive apostrophes. Displaying two consecutive apostrophes would then requires you to use four. This use of a special sequence to refer to a special character is called escaping, and allows you to refer to any character even if there is no key for it on the keyboard.

 ◄   ▲   ►