Teledyne-lecroy USB Script Decode Manual Instrukcja Użytkownika Strona 28

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 90
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 27
22
CHAPTER 7
CATC Scripting Language for USB Statements
if(3-3||2-2)Trace ( "Yes" );
else Trace ( "No" );
will cause No to be printed, because 3-3||2-2will evaluate to False
(neither 3-3nor 2-2is nonzero).
while Statements
A while statement is written as
while <expression><statement>
An example of this is
x=2;
while ( x < 5 )
{
Trace ( x, ", " );
x=x+1;
}
The result of this would be
2, 3, 4,
for Statements
A for statement takes the form
for (<expression1>; <expression2>; <expression3>)
<statement>
The first expression initializes, or sets, the starting value for x. It is executed one
time, before the loop begins. The second expression is a conditional expression. It
determines whether the loop will continue -- if it evaluates true, the function keeps
executing and proceeds to the statement; if it evaluates false, the loop ends. The
third expression is executed after every iteration of the statement.
Figure 7-1: Execution of a for statement
Przeglądanie stron 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 89 90

Komentarze do niniejszej Instrukcji

Brak uwag