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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 82
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 27
Chapter 7: Statements File-based Decoding User Manual
22 LeCroy Corporation
7.3 if-else Statements
The form for an if-else statement is
if <expression> <statement1>
else <statement2>
The following code
str = "";
if ( 3 - 3 || 2 - 2 ) str = FormatEx ( "%s", "Yes" );
else str = FormatEx ( "%s", "No" );
causes “No” to be printed, because 3 - 3 || 2 - 2 evaluates to False (neither
3 - 3 nor 2 - 2 is nonzero).
7.4 while Statements
A while statement is written as
while <expression> <statement>
An example of this is
str = "";
x = 2;
while ( x < 5 )
{
str += FormatEx ( "%d", x );
x = x + 1;
}
The result of this would be
str == "234"
Vista de página 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 81 82

Comentários a estes Manuais

Sem comentários