15.3. Corresponding entries

| Chapter 15: Tables |

| 15.3. Corresponding entries

Continuing our example of the elements:

> Table 2.1 - Selected Elements

> Element | Symbol | Atomic number | Atomic weight
> "Hydrogen" | "H" | 1 | 1
> "Iron" | "Fe" | 26 | 56
> "Zinc" | "Zn" | 30 | 65
> "Uranium" | "U" | 92 | 238

If we want to know the atomic number of Uranium, say, it seems artificial to have to talk about the particular row number where the information happens to be. So we are also allowed to cross-reference, like so:

> the atomic number corresponding to a symbol of "Fe" in the Table of Selected Elements

This results in 26, and similarly

> the symbol corresponding to an atomic number of 26 in the Table of Selected Elements

results in "Fe". But we have to be careful:

> the element corresponding to an atomic number of 27 in the Table of Selected Elements

This is not allowed (it produces an error at run-time), because there is no row with atomic number 27 in this rather limited table. We can check this in advance with the condition:

> if there is an element corresponding to an atomic number of 27 in the Table of Standard Elements ...

Or more simply:

> if there is an atomic number of 27 in the Table of Standard Elements ...

The condition "if there is..." can be used with any reference to a table entry: for instance, "if there is a symbol in row 5 of the Table of Standard Elements" would be false, because there are only four rows.

260
| Example Dubai An elevator which connects any of 27 floors in a luxury hotel. |
RB

Previous | Contents | Next