Teledyne-lecroy Protocol Analyzers File-Based Decoding User Manual Manuel d'utilisateur Page 28

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 82
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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"
Vue de la page 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 81 82

Commentaires sur ces manuels

Pas de commentaire