. navigate
 Navigate
B. Pragmats left arrow
x
right arrow D. Exceptions
Red Reference Manual
C.

BUILT-IN TYPES


BOOL   ENUM   INT   FLOAT   RECORD   UNION   ARRAY   STRING   SET
ACT   MAILBOX   DATA_LOCK   LATCH
FILE   ASCII




C.   BUILT-IN TYPES


C.1  BOOL

Subtype Form

BOOL
Values:  false, true

Literals:  FALSE, TRUE

Operations:

PURPOSE OPERATIONS NOTES
logical negation     NOT(BOOL) => BOOL .
logical and     AND(BOOL, BOOL) => BOOL     1
logical or     OR(BOOL, BOOL) => BOOL     1
exclusive or     XOR(BOOL, BOOL) => BOOL .
eqality     =(BOOL, BOOL) => BOOL .
assignment     :=(BOOL, BOOL) .

  1. These are conditional operations. If the result is known after elaborating the left operand, the right operand is not elaborated.




C.2  ENUM

Subtype Form

1)  ENUM[el1, el2,...,eln]
2)  ENUM[el1, el2,...,eln](min..max)
where el's are enumeration literals, and min and max are expressions with type ENUM[el1, el2,...,eln]. A single literal may appear only once in the extension. Form 1 is equivalent to
ENUM[el1, el2,...,eln](el1..eln)
Values:
The values are the enumeration literals that appear in the type property list restricted to the range min..max. The values are ordered so that if i<j, then eli<elj.

Literals:   All enumeration literals.

Operations:

PURPOSE OPERATIONS NOTES
successor     SUCC(ENUM) => ENUM 1
predecessor     PRED(ENUM) => ENUM 1
position     POS(ENUM) => INT 2
equality     =(ENUM, ENUM) => BOOL     3
ordering     <(ENUM, ENUM) => BOOL     3
assignment     :=(ENUM, ENUM)     3,4

  1. The result subtype is the subtype of the actual parameter. X_RANGE is raised for the successor of the last value and the predecessor of the first value.
  2. When the actual parameter has type ENUM[el1,el2,...eln] and value eli, then the result has subtype INT(l..n) and value i.

  3. Both operands must have the same type.

  4. X_RANGE is raised if the source value is not valid for the target subtype.


Attribute Inquiry

ATTRIBUTE RESULT SUBTYPE RESULT VALUE
ENUM[...](min..max).MIN ENUM[...](min..max) min
ENUM[...](min..max).MAX ENUM[...](min..max) max




C.3  INT

Subtype Form

INT(min..max)
where min and max are expressions having type INT. If the values of min or max exceed the implementation defined largest range, then X_MAXRANGE is raised.

Values:
Integers (whole numbers) in the range min..max.

Literals:   All integer literals.

Operations:

PURPOSE OPERATIONS NOTES
plus     +(INT) => INT 1
minus     -(INT) => INT 1
addition     +(INT, INT) => INT 1
subtraction     -(INT, INT) => INT 1
multiplication     *(INT, INT) => INT 1
exponentiation     **(INT, INT) => INT 1,2
modulo     MOD(INT, INT) => INT     1,3,4
division     DIV(INT, INT) => INT     1,3,4
successor     SUCC(INT) => INT 5
successor     PRED(INT) => INT 5
equality     =(INT, INT) => BOOL x
ordering     <(INT, INT) => BOOL x
absolute value     ABS(INT) => INT 1
assignment     :=(INT, INT) 6
conversion     IFLOAT(INT, INT) => FLOAT 7

  1. Result subtype is INT(imin, imax) where imin and imax values are selected by the implementation so that any result value will be included in the range. Note, however, that this range will never exceed an implementation defined largest range, even if result values outside this range are possible. If this largest range is exceeded, X_OVERFLOW is raised.
  2. Raises X_NEG_EXP if the value of the second actual parameter value is less than zero.  i**0=1

  3. Raises X_ZERO_DIVIDE if the value of the second actual parameter is zero.

  4. The following identities hold:

    1. X=Y*(X DIV Y) + X MOD Y)
    2. Either X MOD U = 0 or X MOD Y and Y have the same algebraic sign.

    3. ABS(X MOD Y) < ABS(Y)

  5. The result subtype is the subtype of the actual parameter. X_RANGE is raised for the successor of the last value, and the predecessor of the first value.

  6. Raises X_RANGE if the source value is not valid for the target subtype.

  7. This function is used to convert an integer to a floating point value. The first actual parameter is the precision of the result, and must be manifest. The second actual parameter is the integer to be converted. See note 1 under FLOAT concerning the range of the result.


  8. Attribute Inquiry

    ATTRIBUTE RESULT SUBTYPE RESULT VALUE
    INT(min..max).MIN INT(min..max) min
    INT(min..max).MAX INT(min..max) max




    C.4  FLOAT

    Subtype Form

    FLOAT(prec, min..max)
    where prec has type INT and must be manifest, and min and max are expressions having type FLOAT. If the value of prec exceeds an implementation defined largest precision, or if the values of min and max exceed an implementation defined largest range, then X_MAXRANGE is raised.

    Values:
    Approximate floating point numbers having precision prec in the range min..max. The precision is the minimum number of decimal digits to be represented. For values around zero, there is a smallest, non-zero absolute value that is implementation dependent.

    Literals:   All FLOAT literals.

    Operations:

    PURPOSE OPERATIONS NOTES
    plus     +(FLOAT) => FLOAT 1
    addition     +(FLOAT, FLOAT) => FLOAT 1
    subtraction     -(FLOAT, FLOAT) => FLOAT 1
    multiplication     *(FLOAT, FLOAT) => FLOAT 1
    division     /(FLOAT, FLOAT) => FLOAT     1,2
    exponentiation     **(FLOAT, INT) => FLOAT     1,3
    equality     =(FLOAT, FLOAT) => BOOL x
    ordering     <(FLOAT, FLOAT) => BOOL x
    absolute value     ABS(FLOAT) => FLOAT 1
    assignment     :=(FLOAT, FLOAT) 4
    conversion     FLOOR(FLOAT) => INT 5, 6

    1. Result subtype is FLOAT(prec, imin..imax) where rec is the maximum of the precisions of the actual parameter(s). Imin and imax values are selected by the implementation so that any result value will be included in the range. Note, however, that this range will never exceed an implementation defined largest range, even if result values outside this range are possible. If this largest range is exceeded, X_OVERFLOW is raised.
    2. Raises X_ZERO_DIVIDE if the value of the second actual parameter is zero.

    3. a**0 = 1. Raises X_NEG_EXP if the value of the second parameter is less than zero.

    4. Raises X_RANGE if source value is not valid for target subtype. If the target has less precision than the source, truncation is performed.

    5. Rounds any fractional part down. FLOAT(X) <= X

    6. See note 1 under INT operations.


    Attribute Inquiry

    ATTRIBUTE RESULT SUBTYPE RESULT VALUE
    FLOAT(prec,min..max) .PREC INT(min..max) prec
    FLOAT(prec,min..max) .MIN FLOAT(prec,min..max) min
    FLOAT(prec,min..max) .MAX FLOAT(prec,min..max) max


    Machine-Dependent Inquiry Functions

    PURPOSE OPERATIONS
    actual precision ACTP(FLOAT) => INT
    radix RADIX(FLOAT) => INT
    minimum exponent     EMIN(FLOAT) => INT
    maximum exponent     EMAX(FLOAT) => INT




    C.5  RECORD

    Subtype Form

    RECORD[ id1:s1, id2:s2,...,idn:sn]
    If several adjacent components have the same subtype, then
    idi, idi+1,...,idj:s
    can be used as a shorthand for
    idi:S, idi+1:S,..., idj:S

    Values:
    An ordered set of name-value pairs, one for each identifier, where the name of the i'th value is idi and the subtype of the i'th value is Si.

    Components: A record variable (or constant) is made up of one or more component variables (or constants). Each component is named by a distinct identifier. The components may have different subtypes.

    Constructor: Also see Section 5.6.

    Operations:

    PURPOSE OPERATIONS NOTES
    equality     =(RECORD, RECORD) => BOOL 1, 2
    assignment     :=(RECORD, RECORD) 1, 3

    1. Actual parameters must have the same type.
    2. Each of the component types must have = defined. Each of the components are compared using = for the component type.

    3. Each of the component types must have := defined. Each of the components are assigned in an undefined order using := for the component type.

    Record Component Selection

    The result of

    R.C
    where R has a RECORD type, is component C of record R. The result is a variable, if R is a variable.




    C.6  UNION

    Subtype Form

    1)  UNION[id1:S1, id2:S2,...,idn:Sn]
    2)  UNION[id1:S1, id2:S2,...,idn:Sn](exp)
    where exp has type ENUM['id1, 'id2,..., 'idn]. None of the idi may be TAG. If several components have the same subtype, then
    idi, idi+1,...,idj:s
    can be used as a shorthand for
    idi:S, idi+1:S,..., idj:S

    Values:
    The discriminated union of the values of each of the component subtypes. Equivalently, a tag-value pair in which the subtype of the value is the one named by the tag. Variables having subtypes of form 2 may only have values whose tag is the value of exp.

    Components: At any time a union variable (or constant) has exactly one named component variable (or constant). Consider

    UNION[idi:S, id2:S,..., idn:S]
    The possible component names are id1, id2, ..., idn. The current component name is called the tag. When the tag is id1, the component variable (or constant) has subtype Si.

    Constructor: Also see Section 5.6.

    Operations:

    PURPOSE OPERATIONS NOTES
    equality     =(UNION, UNION) => BOOL 1, 2
    assignment     :=(UNION, UNION) 1, 3

    1. Actual parameters must have the same type.
    2. Each of the component types must have = defined. Result is true if types are equal, and the current components are equal.

    3. Each of the component types must have := defined. The components is assigned using := for its type. X_RANGE is raised if the source is not valid for the target.

    Union Component Selection

    The result of

    U.C
    where U has a UNION type, is component C of union R. If the selected union component is not currently present, then the X_TAG exception is raised. The result is a variable if U is a variable. The result of

    The result of

    U.TAG
    is a value with subtype ENUM['id1, 'id2,..., 'idn] where the id's are the component names of the UNION type of U in order. The result value is the name of the component currently held by the union.




    C.7  ARRAY

    Subtype Form

    ARRAY index1, index2,..., indexn OF comp
    This is the subtype for an n-dimensional array whose index subtypes are index1, index2,..., indexn. The component subtype is comp. Each index subtype must be either an INT or ENUM subtype.

    Values:
    Arrays of values of the component subtype, where there is one value in the array for each combination of values of the index subtypes.

    Components: An array variable (or constant) has zero or more components, variables (or constants), all with the same component subtype. A component is selected by supplying a value for each index. Note that if any index subtype has no values, the array will have no components.

    Constructor: Also see Section 5.6.

    Operations:

    PURPOSE OPERATIONS NOTES
    equality     =(ARRAY, ARRAY) => BOOL 1, 2
    concatenate     &(ARRAY, ARRAY) => ARRAY 1, 3, 4
    assignment     :=(ARRAY, ARRAY) 1, 3, 5

    1. Actual parameters must have the same type.
    2. The component type must have = defined. The result is true if the index subtypes are equal, and the corresponding components are equal.

    3. The component type must have := defined. Components are assigned using := for the component type. If the source and target overlap, assignment is done in such a way that a target component will not be modified before its use as a source component.

    4. Only 1-dimensional arrays whose index type is INT may be used as actual parameters. If the actual parameters have, respectively, m and n components, then the index subtype of the result is INT{1..m+n).

    5. X_ARRAY is raised if the number of values in the corresponding index subtypes of the source and the target are not equal.

    Index Subtype:   INDEXOF is described in Section 4.5.

    Simple Array Element Selection

    The result of

    A(exp1, exp2,..., expn)
    where A is an n-dimensional array, and the type of each expi is the i'th index type of the array, is the component of A at position specified by the value of the exp's. If the value of any exp is not valid for the corresponding index subtype, the X_SUBSCRIPT exception is raised. The result is a variable if A is a variable.

    Subarray Selection

    The result of

    A(min..max)
    where A is a 1-dimensional array, and the type of min and max is the index type of that array, is a subarray of A. If the range min..max is non-empty and contains and index outside the array bounds, then X_SUBSCRIPT is raised. The result has the same component type as A. The index subtype of the result is the index subtype of A restricted to the range min..max. The result is a variable if A is a variable.




    C.8  STRING

    Subtype Form

    STRING[S] (len)

    Values:

    Character strings with length len. Each character will be a value of the component subtype S. If len is less than or equal to zero, then the string is empty.

    Literals:   All string literals.

    Operations:

    PURPOSE OPERATIONS NOTES
    concatenate     &(ENUM, ENUM) => STRING 1, 2
    concatenate     &(ENUM, ENUM) => STRING 1, 2
    concatenate     &(STRING, ENUM) => STRING 1, 2
    concatenate     &(STRING, STRING) => STRING 1, 2
    equality     =(STRING, STRING) => BOOL 1, 3
    ordering     %lt;(STRING, STRING) => BOOL 1, 4
    assignment     :=(STRING, STRING) 1, 5

    1. Actual parameters must have the same type, or have an ENUM type which is the same as the component type of the string.
    2. The length of the result is the sum of the lengths of the actual parameters.

    3. If the actual parameters have a different length, then the result is false.

    4. Ordering is based on ordering of the type of the characters. Characters are compared left to right, with characters on the left being most significant. if the first actual parameter is a prefix of a longer second parameter, the result is true. If the second actual parameter is a prefix of a longer first actual parameter, then the result is false.

    5. Both actual parameters must have the same length


    Attribute Inquiry

    ATTRIBUTE RESULT SUBTYPE RESULT VALUE
    STRING[S](len) .LEN     INT(len..len) len

    Component Selection

    The result of

    V(I)
    where V is a STRING and I is an integer whose value is between 1 and the length of V, is the I'th character of V. If I is out of bounds, then X_SUBSCRIPT is raised. If V has subtype STRING[S](m), then the result has subtype S. The result is a variable if V is a variable. The result of
    V(I..J)

    where V is a string, and I and J are integers whose value is between I and the length of V, is a substring of V starting at position I and ending at position J. If I or J is out of bounds, then X_SUBSCRIPT is raised. If V has subtype STRING[S](n), then the result has subtype STRING[S](J-I+1).




    C.9  SET

    Subtype Form

    SET[S]

    where S is an INT or ENUM subtype.

    Values:

    Subsets of the set of all values of subtype S.

    Operations:

    PURPOSE OPERATIONS NOTES
    equality     =(SET, SET) => BOOL     1
    subset     <(SET, SET) => BOOL 1
    membership     IN(t, SET[t]) => BOOL     .
    complement     NOT(SET) => SET 2
    intersection     AND(SET, SET) => SET 1, 2
    union     OR(SET, SET) => SET 1, 2
    symmetric difference     XOR(SET, SET) => SET 1, 2
    assignment     :=(SET, SET) 1

    1. Both actual parameters must have the same subtype.
    2. The result subtype is the same as the subtype of the actual parameter(s).




    C.10  ACT

    Subtype Form

    ACT
    Values:

    An ACT variable is used to control the elaboration of some activation, and contains all information needed to record all aspects of that elaboration. There are three components of the value of special interest to the user.

    1. A state - which has three subcomponents, as follows:

      1. active - a boolean. All ACT variables are automatically initialized to be inactive (i.e., active=false).
      2. waiting - a boolean. Initially false.
      3. suspended - a boolean. Initially false.
    2. A priority - A component whose subtype is INT(0..255).

    3. A clock - This measures the total real time that the activation has been running.


    Predefined Constant:  NIL_ACT. Representing a unique, always active value.

    Operations:

    PURPOSE OPERATIONS NOTES
    current activation     ME => ACT 1
    active     ACTIVE(ACT) => BOOL 2
    waiting     WAITING(ACT) => BOOL 3
    suspended     SUSPENDED(ACT) => BOOL 4
    priority     PRIORITY(ACT) => INT 5
    set priority     SET_PRIORITY(ACT, INT) 6
    suspend     SUSPEND(ACT) 7
    unsuspend     UNSUSPEND(ACT) 8
    time     TIME(ACT) => INT 9
    delay     DELAY_UNTIL(ACT, INT) 10, 11
    delay     DELAY_UNTIL_INACTIVE(ACT)     11, 12
    wait     SYNC_WAIT 13
    reset     SYNC_RESET 14
    signal     SYNC_SIGNAL(ACT) 15
    create     TASK_START(ACT) 16
    finish     TASK_END(ACT) 17
    low-level     LOW_SYNC_WAIT 18
    . LOW_SYNC_RESET 18
    . LOW_SYNC_SIGNAL(ACT) 18, 19
    . LOW_TASK_END 20
    terminate     EXTERMINATE(ACT) 21
    terminate control     CRITICAL 22
    . NONCRITICAL 23
    assignment     :=(ACT, ACT) 24
    assignment     =(ACT, ACT) => BOOL 25

    1. Result is the activation variable associated with the invoking activation.
    2. Result is true if the specified activation is active.

    3. Result is true if the specified activation variable is active and waiting.

    4. Result is true if the specified activation variable is suspended.

    5. Result is the priority of the specified activation.

    6. Sets the priority of the specified activation.

    7. Sets suspended to true.

    8. Sets suspended to false.

    9. The result is the value of the activation clock of the specified activation in ticks.

    10. Delays until the activation clock of the specified activation is greater than or equal to the time specified in ticks.

    11. These operations can be used as waiting invocations in the wait statement.

    12. Waits until the specified activation variable is inactive.

    13. Equivalent to LOW_SYNC_WAIT if the current activation was created with an ACT-type activation variable, or to SYNC_WAIT(av) if the current activation was created with activation variable av of user-defined type.

    14. Equivalent to LOW_SYNC_RESET or SYNC_RESET(av) depending on how activation a was created.

    15. Equivalent to LOW_SYNC_SIGNAL(a) or SYNC_SIGNAL(av) depending on how activation a was created.

    16. Used to start an activation. Called as part of the elaboration of a task invocation statement. Assigns second parameter to first.

    17. Equivalent to LOW_TASK_END(a) or TASK_END(av) as in (15).

    18. LOW_SYNC_WAIT sets waiting to true unless LOW_SYNC_SIGNAL has been called for this activation since LOW_SYNC_RESET was invoked.

    19. Sets waiting to false.

    20. Invoked when an activation is complete. Can also be used to terminate some other task.

    21. For the given activation, sets waiting to false, and raises the X_TERMINATE exception.

    22. Make activation critical.

    23. Make activation noncritical.

    24. This is a sharing assignment.

    25. The result is true if both actual parameters are the same activation variable.




    C.11  MAILBOX

    Subtype Form

    MAILBOX[S] (len)

    where S is the subtype of messages and len is an integer which is greater than or equal to zero. Assignment must be defined for the type of S.

    Values:

    A mailbox can hold up to len messages having subtype S. All mailbox variables are automatically initialized to hold no messages. Messages are queued first-in first-out.

    Operations:

    PURPOSE OPERATIONS NOTES
    send     SEND(MAILBOX[t], t) 1, 2
    receive     RECEIVE(MAILBOX[t], t) 2, 3
    test empty     EMPTY_SLOTS(MAILBOX) => INT     4
    test full     FULL_SLOTS(MAILBOX) => INT 5
    conditional send     COND_SEND
    (MAILBOX[t], t, BOOL)
    6
    conditional receive     COND_RECEIVE
    (MAILBOX[t], t, BOOL)
    7
    low-level ops     SEND_ST 8
    . SEND_REQUEST(MAILBOX[t], t) 9
    . SEND_TEST(MAILBOX[t], t) 9
    . SEND_COMPLETE
    (MAILBOX[t], t)
    9
    . SEND_REVOKE(MAILBOX[t], t) 9
    . RECEIVE_ST 10
    . RECEIVE_REQUEST
    (MAILBOX[t], t)
    11
    . RECEIVE_TEST (MAILBOX[t], t) 11
    . RECEIVE_COMPLETE
    (MAILBOX[t], t)
    11
    . RECEIVE_REVOKE
    (MAILBOX[t], t)
    11
    assignment     :=(MAILBOX, MAILBOX) 12
    equality     =(MAILBOX, MAILBOX) 13

    1. Sends a message to a mailbox. Sender waits if the mailbox is full until the mailbox is no longer full. If there are several waiting senders, they are queued first-in first-out.
    2. These operations can be used as waiting invocations in the wait statement. If SEND is called on a zero length mailbox in a multi-way wait statement, then X_EMPTY_MAILBOX is called.

    3. Receives a message from a mailbox. Receiver waits if the mailbox is empty until the mailbox is no longer empty. If there are several waiting receivers, they are queued first-in first-out.

    4. Count of empty message slots plus waiting receivers.

    5. Count of full message slots plus waiting receivers.

    6. Try to send; indicate success as a returned boolean (true=success). Never wait.

    7. Try to receive; indicate success as a returned boolean. Never wait.

    8. Subtype for low-level implementation of sends. See Section 14.3.1.

    9. Operations for low-level implementation of sends.

    10. Operations for low-level implementation of receives. See Section 14.3.1.

    11. Operations for low-level implementation of receives.

    12. This is a sharing assignment.

    13. The result is true if both actual parameters are the same mailbox.


    Attribute Inquiry

    ATTRIBUTE RESULT SUBTYPE RESULT VALUE
    MAILBOX[S](len) .LEN INT(len..len) len




    C.12  DATA_LOCK

    Subtype Form

    DATA_LOCK
    Values:

    A data lock is either locked or unlocked. All data lock variables are automatically initialized to be unlocked. If a data lock is locked, it has an owner, which is the activation that locked it.

    Operations:

    PURPOSE OPERATIONS NOTES
    test locked     EXCESS_LOCKS(DATA_LOCK) => INT     .
    owner     OWNER(DATA_LOCK) => ACT .
    lock     LOCK(DATA_LOCK) 2, 3
    unlock     UNLOCK(DATA_LOCK) 1, 3
    conditional lock     COND_LOCK(DATA_LOCK, BOOL) .

    1. If not locked, raises X_LOCK.
    2. If data lock is unlocked, sets the data lock to be locked and the owner to be the invoking activation; otherwise, the invoker waits until the data lock becomes unlocked. If there are several activations suspended, these are processed on a first-come first-served basis.

    3. These are low-level operations used to implement user-defined locking operations, and in the implementation of the REGION statement.




    C.13  LATCH

    Subtype Form

    LATCH
    Values:  latched, unlatched

    Operations:

    PURPOSE OPERATIONS NOTES
    lock     LOCK(LATCH) 1
    unlock     UNLOCK(LATCH) 2
    test and set     COND_LOCK(LATCH, BOOL) 3

    1. Waits until the actual parameter has value unlatched; then changes the value to latched and continues. If several tasks are waiting, only one will continue.
    2. Changes the value of the actual parameter to unlatched.

    3. The second parameter is a status result. If latch has the value unlatched, then performs a LOCK and sets result to true; otherwise, sets result to false.




    C.14  FILE

    Subtype Form

    FILE [S] (access, use)

    Each component will have subtype S. Assignment must be defined for the type of S. The type of access must be ENUM['SEQ, 'RANDOM]. The type of use must be ENUM['INPUT, 'OUTPUT, 'UPDATE].


    Values and Components

    A file variable (also called a file) is associated with an ordered sequence of components, each having subtype S. The components will reside on some particular physical file of the target system. A file variable is associated with a particular physical file by invocation of the OPEN procedure (the file is then said to be open). The association is broken by invocation of the CLOSE procedure (the file is then said to be closed). Initially all files are closed.

    The access of a file determines how the components are accessed.

    'SEQ     sequential access    
    'RANDOM     random access

    The use of a file determines how the file will be used.

    'INPUT     components are read but not written.    
    'OUTPUT     components are written but not read.
    'UPDATE     components are both written and read.

    When a file is open, it has a size which is the number of components in the file, and a position, which is an integer whose value is greater than or equal to 1, and which is less than or equal to the size of the file plus 1. Position 1 is before all components in the file. Position 2 is before the second component, etc.

    Operations:

    PURPOSE OPERATIONS NOTES
    open     OPEN(FILE, STRING,
      ENUM['OLD), 'NEW]
    1, 2
    close     CLOSEFILE
      ENUM['SAVE, DELETE]    
    3, 4
    size     SIZE(FILE) => INT 3,  5,  6,  15
    position     POSITION(FILE) => INT 3,  7,  15
    set position     SET_POSITION(FILE, INT) 3,   5,  8
    end of file     EOF(FILE) => BOOL 3,  9,  15
    read     READ(FILE, t) 3,  10,  11
    write     WRITE(FILE, t) 3,  11,  13  14
    read line     READLN(FILE, STRING) 15,  16  17
    write line     WRITELN(FILE, STRING)     16  18
    line size     SIZELN(FILE) => BOOL     15  23
    eof     EOF()     15  22
    other     see note     24

    1. Raises X_FILE if file is already open.
    2. The string specifies the physical file with which the file variable is to be associated. The interpretation of the string is implementation-dependent. If there is no such device or physical file, then the X_FILENAME exception is raised. The enumeration value specifies whether an existing file is to be used ('OLD), or a new file is to be created ('NEW). If for 'OLD there is no existing physical file, then the X_NOFILE exception is raised. The position of the file is set to 1. A 'NEW file initially has size 0.

    3. Raises X_FILE if file is not open.

    4. The enumeration value 'SAVE indicates that the physical file is to be saved for use by latter programs. The value 'DELETE indicates that the physical file is not to be saved. The current position is taken as the new end of file.

    5. These procedures and functions may not be available for all physical files. If not, the X_FILE exception is raised. They will, however, always be available for 'RANDOM access files.

    6. Returns the size of the file.

    7. Returns the current position.

    8. This procedure repositions the file to the specified new position. If the integer parameter is less than 1, or greater than the size of the file +1, then the X_FILEPOS exception is raised.

    9. Returns true if the position of the file is equal to the size of the file +1.

    10. Legal only if use is 'INPUT or 'UPDATE. Otherwise, X_FILE is raised.

    11. The second parameter must have the same type as the components of the file.

    12. The component following the current position is assigned to the second parameter. The current position is incremented by one. If EOL is true, then the X_EOF exception is raised.

    13. If EOF is true prior to the invocation, then the number of components in the file is increased by one. The component following the current position is assigned the value of the second parameter. The current position is incremented by one.

    14. Legal only if use is 'OUTPUT or 'UPDATE. Otherwise, X_FILE is raised.

    15. These are abnormal functions. See Section 7.2.1.

    16. The file type must be FILE[ENUM[...]]/ The ENUM type must include 'CR and 'LF.

    17. READLN reads components until a 'CR followed by a 'LF is found. All components prior to the 'CR "LF are returned as characters in the string. Raises X_LN if no 'CR followed by 'LF is found, or if the string is of the wrong length.

    18. Writes each character in the string as a component in the file, and then writes a 'CR followed by a 'LF.

    19. Returns the number of characters between the current position and the position immediately before the next 'CR followed by 'LF.

    20. READLN(s) is equivalent to READLN(SYS_IN, s).

    21. WRITELN(s) is equivalent to WRITELN(SYS_IN, s).

    22. EOF is equivalent to EOF(SYS_IN).

    23. SIZELN is equivalent to SIZE(SYS_IN).

    24. It is anticipated that a variety of implementation-dependent and/or device-dependent routines will be available for setting and interrogating file characteristics such as protection, physical blocking, and file space.


    Attribute Inquiry

    ATTRIBUTE RESULT SUBTYPE RESULT VALUE
    FILE[S](access, use) .ACCESS ENUM['INPUT, 'OUTPUT, 'UPDATE]( access
    FILE[S](access, use) .USE ENUM['INPUT, 'OUTPUT, 'UPDATE]( use




    C.15  ASCII

    The 128 character ASCII character set is a language defined abbreviation. Its definition appears below.

125 characters ascii






BOOL   ENUM   INT   FLOAT   RECORD   UNION   ARRAY   STRING   SET
ACT   MAILBOX   DATA_LOCK   LATCH
FILE   ASCII

B. Pragmats left arrow
x
right arrow D. Exceptions


Overview

Requirements
     Strawman
     Woodenman
     Tinman
     Ironman
     Steelman

RED Reference
RED Rationale

Types in RED
Time/Life Computer Languages
Memories

Site Index

Overview             Reference ToC             Rationale ToC             Site Index



Home   Favorites   Map

IME logo Copyright © 2009, Mary S. Van Deusen