IT. Expert System.

C#

Blocks


A block permits multiple statements to be written in contexts where a single statement is allowed.

block:
{ statement-listopt }

A block consists of an optional statement-list , enclosed in braces. If the statement list is omitted, the block is said to be empty.

A block may contain declaration statements . The scope of a local variable or constant declared in a block is the block.

Within a block, the meaning of a name used in an expression context must always be the same .

A block is executed as follows:

  • If the block is empty, control is transferred to the end point of the block.

  • If the block is not empty, control is transferred to the statement list. When and if control reaches the end point of the statement list, control is transferred to the end point of the block.

The statement list of a block is reachable if the block itself is reachable.

The end point of a block is reachable if the block is empty or if the end point of the statement list is reachable.

A block that contains one or more yield statements is called an iterator block. Iterator blocks are used to implement function members as iterators . Some additional restrictions apply to iterator blocks:

  • It is a compile-time error for a return statement to appear in an iterator block (but yield return statements are permitted).

  • It is a compile-time error for an iterator block to contain an unsafe context . An iterator block always defines a safe context, even when its declaration is nested in an unsafe context.

      1. Statement lists

A statement list consists of one or more statements written in sequence. Statement lists occur in blocks and in switch-blocks .

statement-list:
statement
statement-list statement

A statement list is executed by transferring control to the first statement. When and if control reaches the end point of a statement, control is transferred to the next statement. When and if control reaches the end point of the last statement, control is transferred to the end point of the statement list.

A statement in a statement list is reachable if at least one of the following is true:

  • The statement is the first statement and the statement list itself is reachable.

  • The end point of the preceding statement is reachable.

  • The statement is a labeled statement and the label is referenced by a reachable goto statement.

The end point of a statement list is reachable if the end point of the last statement in the list is reachable.



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 271 / 158859319. Delta: 0.10209 с