The Microsoft Excel File Format - OpenOffice.org
The Microsoft Excel File Format - OpenOffice.org
The Microsoft Excel File Format - OpenOffice.org
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
3 Formulas<br />
Example of the formula = CHOOSE(2, 1,2, 3). <strong>The</strong> formula contains spaces before the function<br />
identifier and before the second and fourth parameter.<br />
Offset Size Token name Description<br />
0 2 tInt <strong>The</strong> choice: the integer constant 2 (take second choice)<br />
2 12 tAttrChoose Function contains 3 choices (nc = 3)<br />
Jump table: distances to start positions of the next nc = 3<br />
parameters (including the size of this jump table:<br />
nc∙2+2 = 3∙2+2 = 8 bytes):<br />
- First choice: 8 bytes (skip the jump table only)<br />
- Second choice: 8+7+4 = 19 bytes<br />
- Third choice: 8+7+7+4 = 26 bytes<br />
Distance to start of tFuncVar(CHOOSE) token (including<br />
jump table size, leading tAttrSpace tokens will be skipped<br />
too): 8+7+7+11+8 = 41 bytes<br />
14 4 tAttrSpace Leading spaces for the next token<br />
18 3 tInt First choice parameter: the constant 1<br />
21 4 tAttrSkip Distance to position behind tFuncVar(CHOOSE) token<br />
(minus 1): 11+11+8–1 = 29 bytes<br />
25 3 tInt Second choice parameter: the constant 2<br />
28 4 tAttrSkip Distance to position behind tFuncVar(CHOOSE) token<br />
(minus 1): 11+8–1 = 18 bytes<br />
32 4 tAttrSpace Leading spaces for the next token<br />
36 3 tInt Third choice parameter: the constant 3<br />
39 4 tAttrSpace Leading spaces for the next token (the function identifier).<br />
Note that the tAttrSpace tokens related to the function<br />
itself are located before the tAttrSkip token!<br />
43 4 tAttrSkip Distance to position behind tFuncVar(CHOOSE) token<br />
(minus 1): 4–1 = 3 bytes<br />
47 4 tFuncVar(CHOOSE) Identifier of the CHOOSE function with 4 parameters<br />
• Jump to Position – <strong>The</strong> tAttrSkip Token<br />
This token is used to let formula evaluation continue at another position in the token array. It contains the number of<br />
bytes to skip from the current position. For no obvious reason, this value is always one less than the actual number. This<br />
token is only used in conjunction with the tAttrIf token and tAttrChoose token (see tAttrIf and tAttrChosse tokens above<br />
for examples).<br />
Token tAttrSkip, BIFF2:<br />
Offset Size Contents<br />
0 1 19 H<br />
1 1 08 H (identifier for the tAttrSkip token)<br />
2 1 Distance (number of bytes) from start of next token to destination position, decreased by 1<br />
Token tAttrSkip, BIFF3-BIFF8:<br />
Offset Size Contents<br />
0 1 19 H<br />
1 1 08 H (identifier for the tAttrSkip token)<br />
2 2 Distance (number of bytes) from start of next token to destination position, decreased by 1<br />
70