FACTOID # 141: Norwegians drink 10.7 kilograms of coffee per person each year. They also lead the globe in anxiety disorders. Maybe it’s time to switch to herbal tea.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Statement (programming)

A statement is the minimal unit of structuring in imperative programming languages.


The following are the major generic kinds of statements with examples in Pascal, a typical imperative language:

  • definition: TYPE SALARY = INTEGER
  • declaration: VAR A:INTEGER
  • assignment: A := A + 1
  • sequence: A := A + 1; WRITELN(A)
  • conditional: IF A > 3 THEN WRITELN(A) ELSE WRITELN("NOT YET") END
  • loop: FOR A:=1 TO 10 DO WRITELN(A) END
  • call: CLEARSCREEN()

Statements contrast with expressions in that the former do not return results and are executed solely for their side effects, while the latter always return a result and often do not have side effects at all.


In block-structured programming languages, statements are grouped into statement blocks.


  Results from FactBites:
 
USE Statement Programming Notes (224 words)
Therefore, if any other I-O statement is executed for a file that has never been opened, no Declarative can receive control.
For example, an OPEN OUTPUT statement establishes a Declarative procedure for this file, and the file is then closed without error.
Error Handling: If there is an applicable file status clause (but not an applicable USE procedure) when an I-O error occurs, the file status is updated, and control returns to the program.
Programming With Assertions (4371 words)
The program would work fine when asserts were enabled, but would fail when they were disabled, as it would no longer remove the null elements from the list.
The assert statement may, however, be used in conjunction with the "conditional compilation" idiom described in JLS 14.20, enabling the compiler to eliminate all traces of these asserts from the class files that it generates:
It is generally the case that programs using new facilities are not compatible with older releases.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.