Table of Contents
Now that we have learned how data can be stored and evaluated in YCP
,
we will take a look at the surrounding code structure that can be
realized. Code structure is created by means of
blocks and statements.
Despite not being “really”
statements, comments do (and should) belong to
the overall structure of a YCP
program. There are two kinds of
comments:
Single-line comments
Single-line comments may start at any position on the line and reach up to the end of this line. They are introduced with “//”.
Multi-line comments
Multi-line comments may also start at any position on the line
but they may end on another line below the starting line.
Consequently there must be a start tag
(“/*
”) and an end tag
(“*/
”) as is shown below.
Example 8.1. Comments
{ // A single-line comment ends at the end of the line. /* Multi-line comments may span several lines. */ y2milestone("This program runs without error"); }