Teledyne-lecroy USB Script Decode Manual Manual de usuario Pagina 28

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 90
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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
Vista de pagina 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 89 90

Comentarios a estos manuales

Sin comentarios