Skip to main content

1985 | OriginalPaper | Buchkapitel

Subrange types

verfasst von : Professor Dr. Niklaus Wirth

Erschienen in: Programming in Modula-2

Verlag: Springer Berlin Heidelberg

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

If a variable is known (or supposed) to assume values within a certain contiguous range only, this fact can be specified by declaring it to be of a so-called subrange type. Assume, for example, that a variable i assumes values in the range from 1 up to (and including) N only, we specify $$\begin{array}{*{20}{c}} {{\text{TYPES = }}\left[ {{\text{1}}..{\text{N}}} \right]} \\ {{\text{VARi}}:{\text{S }}} \end{array} $$ (this can, of course, be abbreviated by VAR i: [1.. N] ).

Metadaten
Titel
Subrange types
verfasst von
Professor Dr. Niklaus Wirth
Copyright-Jahr
1985
Verlag
Springer Berlin Heidelberg
DOI
https://doi.org/10.1007/978-3-642-96878-5_18