FUNCTION $device_attributes, $da (
  device_environment_variable: name = $required
  attribute: key
      (banner_highlight_field, bhf)
      (banner_page_count, bpc)
      (carriage_control_support, ccs)
      (code_set, cs)
      (device_alias_1, da1)
      (device_alias_2, da2)
      (device_alias_3, da3)
      (device_name, dn)
      (device_type, dt)
      (external_characteristics_1, ec1)
      (external_characteristics_2, ec2)
      (external_characteristics_3, ec3)
      (external_characteristics_4, ec4)
      (file_acknowledgement, fa)
      (forms_code_1, fc1)
      (forms_code_2, fc2)
      (forms_code_3, fc3)
      (forms_code_4, fc4)
      (forms_size, fs)
      (maximum_file_size, mfs)
      (page_width, pw)
      (station, s)
      (terminal_model, tm)
      (tip_type, tt)
      (transmission_block_size, tbs)
      (undefined_fe_action, undfa)
      (unsupported_fe_action, unsfa)
      (vertical_print_density, vpd)
      (vfu_load_option, vlo)
      (vfu_load_procedure, vlp)
    keyend = $required
  )

" PURPOSE:
"   This function returns the value of the specified device attribute.
"
" DESIGN:
"   Create internal variable RESULT with the value of the field in the
"   DEVICE_ENVIRONMENT_VARIABLE specified by ATTRIBUTE.  If RESULT is of
"   type FILE then the DEVICE_ENVIRONMENT_VARIABLE parameter is of the
"   wrong type (SCL thought the '.' implied a file, not a record) and
"   return an error, otherwise return RESULT.
"
" NOTE:
"   This function is not meant to be modified.

  include_command 'result = '//device_environment_variable//'.'//attribute

  IF $generic_type(result) = file THEN
    CAUSE $status(false, 'CL' cle$unknown_variable, ..
          $string(device_environment_variable)//' is of wrong type, or ')
  ELSE
    EXIT function WITH result " Normal exit
  IFEND

FUNCEND $device_attributes
