beautypg.com

Teledyne LeCroy Protocol Analyzers File-Based Decoding User Manual User Manual

Page 31

background image

File-based Decoding User Manual

Chapter 7: Statements

LeCroy Corporation

25

However,

str = FormatEx ( "%s", HiThere() );
...
HiThere()
{

a = "Hi there";
b = "Goodbye";
if ( 3 != 3 ) return a;
else return b;

}

results in "Goodbye" getting assigned to str, 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 FormatEx.