Teledyne-lecroy Protocol Analyzers File-Based Decoding User Manual Manual do Utilizador Página 27

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 82
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 26
File-based Decoding User Manual Chapter 7: Statements
LeCroy Corporation 21
Chapter 7: Statements
Statements are the building blocks of a program. A program is made up of list of
statements.
Seven kinds of statements are used in CSL: expression statements, if statements, if-else
statements, while statements, for statements, return statements, and compound
statements.
7.1 Expression Statements
An expression statement describes a value, variable, or function.
<expression>
Here are some examples of the different kinds of expression statements:
Value: x + 3;
Variable: x = 3;
Function: FormatEx ("%s", x);
The variable expression statement is also called an assignment statement, because it
assigns a value to a variable.
7.2 if Statements
An if statement follows the form
if <expression> <statement>
For example,
str = "";
if (3 && 3) str = FormatEx ( "%s", "True!" );
causes the program to evaluate whether the expression 3 && 3 is nonzero, or True. It
is, so the expression evaluates to True and the
FormatEx statement is executed. On the
other hand, the expression
3 && 0 is not nonzero, so it would evaluate to False, and the
statement would not be executed.
Vista de página 26
1 2 ... 22 23 24 25 26 27 28 29 30 31 32 ... 81 82

Comentários a estes Manuais

Sem comentários