ErrorStop

Stops the program with an error status.

Declaration

Syntax

ErrorStop(expr? code)

Arguments

Argument

Description

code

the stop code, or nil. An integer becomes the exit status and a character value is written to the error unit.

Return values

None.

Description

error stop terminates the whole program, and unlike Stop it is an error termination: no further output is flushed in an orderly way and, in a coarray program, the other images are terminated as well.

Examples

(ErrorStop
  :code (IntegerConstant
    :n 1
    :type (Integer
      :kind 4
    )
    :intboz_type :Decimal
  )
)

It comes from this complete ASR text document:

(TranslationUnit
  :symtab (SymbolTable
    :id 0
    :symbols {
      "main" (Program
        :symtab (SymbolTable
          :id 1
          :symbols {
            "i" (Variable
              :parent_symtab 1
              :name "i"
              :dependencies []
              :intent :Local
              :symbolic_value nil
              :value nil
              :storage :Default
              :type (Integer
                :kind 4
              )
              :type_declaration nil
              :abi :Source
              :access :Public
              :presence :Required
              :value_attr false
              :target_attr false
              :contiguous_attr false
              :bindc_name nil
              :is_volatile false
              :is_protected false
              :pass_attr :NotMethod
              :self_argument nil
              :codims []
            )
          }
        )
        :name "main"
        :dependencies []
        :body [
          (ErrorStop
            :code (IntegerConstant
              :n 1
              :type (Integer
                :kind 4
              )
              :intboz_type :Decimal
            )
          )
          (Stop
            :code (IntegerConstant
              :n 0
              :type (Integer
                :kind 4
              )
              :intboz_type :Decimal
            )
          )
        ]
      )
    }
  )
  :items []
)

See Also

Stop, Assert