Teledyne-lecroy Protocol Analyzers File-Based Decoding User Manual Uživatelský manuál Strana 28

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 82
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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"
Zobrazit stránku 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 81 82

Komentáře k této Příručce

Žádné komentáře