13.07.2015 Views

apple-pascal-1.3-manual

apple-pascal-1.3-manual

apple-pascal-1.3-manual

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.

elements. If you turn off range checking with the j$R-f Compiler option(described at the end of Chapter 6) you can also read or set the value of astring's zeroth element, which contains its length.Elements of string variables designated by indexing are themselvesvariables of the type CHAR. They can be used in the following operations::= < > = = CHR ORD SUCC PREDIf you attempt to write a one-character string constant, Pascal will give ittype CHAR. But a string variable, even when it contains a single character,is always type STRING and not type CHAR.The SET TypeA Pascal set is an unordered collection of up to 512 members, each ofwhich must be a value of the same scalar type. This type is the set's basetype. Thus a Pascal set may have any one of these base types or theirsubranges:INTEGER CHAR BOOLEAN User-defined scalar typeAll these types are discussed in Chapter 3.Pascal sets can be created in two ways:o By writing a set type or variable declaration.o By writing a set constructor.Sets provide an easy way to determine whether a scalar quantity fallswithin a specific definition. They have the added feature that set operationsgenerally execute very rapidly.Set DeclarationsA type designation of the following form is used to create set types andvariables:III-40Chapter 4: Structured Data Types

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

Saved successfully!

Ooh no, something went wrong!