|
To access the contents, click the chapter and section titles.
Learn Pascal in a Three Days (2nd Ed.)
IntersectionThe intersection of two sets results in a set whose members are the elements common to both sets. For example, the statement: MLL:= [C,CPP,Cobol] * [Basic,Fortran,C,CPP] results in the set MLL, which contains C and CPP. DifferenceThe difference of two sets S1 and S2 is the set whose members are in S1 but not in S2. For example, the statement: HLL:= ProgCodes - LLL; results in the set HLL, which contains all the elements of the set ProgCodes except Assembly. Relational OperatorsThe relational operators =, >=, <=, and <> can be used with sets of compatible types. The meanings of the set relational operators are indicated in Table 8-1 by comparing two sets S1 and S2. The table contains TRUE expressions as examples of each operation. The operators > and < are not mentioned in the table as they may not be used with sets.
The relative precedence of Pascal operators (including the new operator IN ) is shown in Table 8-2. Notice that the set operators (+, -, *) use the same symbols as the arithmetic operators. Also, the relational operators are used with either simple data types or sets.>
You may combine relational expressions using the boolean operators AND, OR, and NOT, but you must watch the precedence of operators, for example: IF (Ch IN Small) AND (Ch IN Capital) THEN... The parentheses are necessary in this expression because the IN operator has a lower precedence than the AND operator.
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |