07.05.2014 Views

The Microsoft Excel File Format - OpenOffice.org

The Microsoft Excel File Format - OpenOffice.org

The Microsoft Excel File Format - OpenOffice.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.10 Control Tokens<br />

• Volatile Formula – <strong>The</strong> tAttrVolatile Token<br />

If the formula contains a volatile function (a function that needs to be recalculated always, for example the NOW<br />

function, ➜3.11), or a defined name that directly or indirectly includes a volatile function, this token will lead the token<br />

array (except in assignment-style formulas in macro sheets, see tAttrAssign token below).<br />

Token tAttrVolatile, BIFF2:<br />

Offset Size Contents<br />

0 1 19 H<br />

1 1 01 H (identifier for the tAttrVolatile token)<br />

2 1 Not used<br />

Token tAttrVolatile, BIFF3-BIFF8:<br />

Offset Size Contents<br />

0 1 19 H<br />

1 1 01 H (identifier for the tAttrVolatile token)<br />

2 2 Not used<br />

• IF Function Control – <strong>The</strong> tAttrIf Token<br />

This token always follows the first parameter of the IF function (containing the condition). It contains a relative offset<br />

that allows to skip the true parameter of the function (second parameter), if the condition evaluates to false.<br />

<strong>The</strong> token promises that the topmost operand on the formula stack (the last processed subexpression) is the condition of<br />

an IF function. This operand is popped from the stack, and processing continues depending on its value.<br />

• If the condition is true, the following tokens are processed, and at the end of the parameter, a tAttrSkip token (see<br />

below) will occur that jumps right behind the tFuncVar(IF) token (this has to be assured during creation of the<br />

formula). Thus, the false parameter is not evaluated at all, and cannot cause an error code as final formula result, if it<br />

contains an error.<br />

• If the condition is false, the following tokens are skipped (the true parameter), and evaluation continues with the false<br />

parameter. Again, at the end of the parameter, a tAttrSkip token will occur that jumps behind the tFuncVar(IF) token.<br />

If the false parameter does not exist, the tAttrIf token causes to jump to the tFuncVar(IF) token, and a simple false<br />

constant is pushed onto the formula stack.<br />

If the IF function is processed, the result of either the true parameter or the false parameter will be on top of the formula<br />

stack.<br />

Token tAttrIf, BIFF2:<br />

Offset Size Contents<br />

0 1 19 H<br />

1 1 02 H (identifier for the tAttrIf token)<br />

2 1 Distance (number of bytes) from start of next token (first token of second parameter) to<br />

start of first token of the false parameter (if extant); otherwise to start of the respective<br />

tFuncVar(IF) token. See example below for more details.<br />

Token tAttrIf, BIFF3-BIFF8:<br />

Offset Size Contents<br />

0 1 19 H<br />

1 1 02 H (identifier for the tAttrIf token)<br />

2 2 Distance (number of bytes) from start of next token (first token of second parameter) to<br />

start of first token of the false parameter (if extant, including all leading tAttrSpace<br />

tokens); otherwise to start of the respective tFuncVar(IF) token (skipping all leading<br />

tAttrSpace tokens related to the tFuncVar token). See example below for more details.<br />

67

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!