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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 90
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 29
24
CHAPTER 7
CATC Scripting Language for USB Statements
Trace ( HiThere() );
...
HiThere()
{
a = "Hi there";
return a;
b = "Goodbye";
return b;
}
will output only
Hi there
because when return a; is encountered, execution of the function terminates,
and the second return statement (return b;) is never processed. However,
Trace ( HiThere() );
...
HiThere()
{
a = "Hi there";
b = "Goodbye";
if(3!=3)return a;
else return b;
}
will output
Goodbye
because the if statement evaluates to false. This causes the first return statement
to be skipped. The function continues executing with the else statement, thereby
returning the value of b to be used as an argument to Trace.
Compound Statements
A compound statement, or statement block, is a group of one or more statements
that is treated as a single statement. A compound statement is always enclosed in
curly braces ( {} ). Each statement within the curly braces is followed by a semi-
colon; however, a semicolon is not used following the closing curly brace.
The syntax for a compound statement is
{
<first_statement>;
<second_statement>;
Vista de pagina 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 ... 89 90

Comentarios a estos manuales

Sin comentarios