Home   :   Matrix Language   :   Primitive System Statements   :   Subrange Statements

Subrange Statements

 

Statements

 

SubrangeInteger

SubrangeBoolean

SubrangeEnumeration

SubrangeFixed

SubrangeFloat

SubrangeString

 

 

General

 

Subrange statements specify further constraints on values the subtype can take on from the base type.

 

 

SubrangeInteger Statement

 

Subtype

IntegerSubtype

SubrangeInteger:Sys_Typ_Int_Fst_Lst

Sub_Fst_Lst : <<First>> .. <<Last>>

Sub_Fst_Neg : <<First>> ..    -9000

Sub_Pos_Lst :     +9000 .. <<Last>>

Sub_Pos_Pos :      1000 ..     9000

 

The SubrangeInteger statement is used to specify a new integer type that is based on an existing integer type.

 

 

SubrangeBoolean Statement

 

Subtype

BooleanSubtype

SubrangeBoolean:Bol_Bool

Sub_Loop

Sub_Turn

 

The SubrangeBoolean statement is used to specify a new Boolean type that is based on an existing Boolean type.

 

 

SubrangeEnumeration Statement

 

Subtype

EnumerationSubtype

SubrangeEnumeration:Enm_Day

Sub_Restday : <<First>> .. <<Last>>

Sub_Workday : MONDAY    .. FRIDAY

Sub_Talkday : TUESDAY   .. THURSDAY

Sub_Weekend : SATURDAY  .. SUNDAY

 

The SubrangeEnumeration statement is used to specify a new enumeration type that is based on an existing enumeration type.

 

 

SubrangeFixed Statement

 

Subtype

FixedSubtype

SubrangeFixed:Neg_Num

Sub_Sme_Fst_Lst : <<Same>> : <<First>> .. <<Last>>

Sub_Num_Neg_Num :    0.001 :     -10.0 ..      1.0

Sub_Num_Neg_Neg :    0.001 :      10.0 ..    100.0

 

The SubrangeFixed statement is used to specify a new fixed type that is based on an existing fixed type.

 

 

SubrangeFloat Statement

 

Subtype

FloatSubtype

SubrangeFloat:Sme_Fst_Lst

Sub_Sme_Fst_Lst : <<Same>> : <<First>> .. <<Last>>

Sub_Num_Neg_Pos :        3 :     -80.0 ..    +70.0

Sub_Num_Num_Num :        2 :       4.0 ..     40.0

 

The SubrangeFloat statement is used to specify a new float type that is based on an existing float type.

 

 

SubrangeString Statement

 

Subtype

StringSubtype

SubrangeString:Str_Sme

Sub_Sme : <<Same>>

Sub_Num :      100

 

The SubrangeString statement is used to specify a new string type that is based on an existing string type.

Copyright 2017 Dark Matter Systems Ltd. All Rights Reserved.