1985 | OriginalPaper | Buchkapitel
Subrange types
verfasst von : Professor Dr. Niklaus Wirth
Erschienen in: Programming in Modula-2
Verlag: Springer Berlin Heidelberg
Enthalten in: Professional Book Archive
Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.
Wählen Sie Textabschnitte aus um mit Künstlicher Intelligenz passenden Patente zu finden. powered by
Markieren Sie Textabschnitte, um KI-gestützt weitere passende Inhalte zu finden. powered by
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] ).