Teledyne-lecroy Protocol Analyzers File-Based Decoding User Manual User Manual Page 28

  • Download
  • Add to my manuals
  • Print
  • Page
    / 82
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 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"
Page view 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 81 82

Comments to this Manuals

No comments