
PROC change_menu_ve_activation, chamva (
  automatic, a         : boolean = yes
  natural_language, nl : name = us_english
  status               : var of status = $optional
  )

*IF $variable(wev$proc_doc,declared)<>'UNKNOWN'

"     The purpose of this command is to turn 'on' or 'off' the automatic
"activation of the MENU/VE user menu.  This is accomplished by modifying the
"SYSTEM_PROLOG by either adding or deleting the INITIALIZE_USER_MENU command
"and the associated delimiter lines, respectively.
*IFEND

  create_variable ignore_status k=status
  create_variable local_status k=status
  create_variable system_prolog k=string v='$system.prologs_and_epilogs.system_prolog'
  create_variable menu_startup_commands k=string v='$local.'//$unique

COLLECT_TEXT o=$fname(menu_startup_commands) until='END_COLLECT' sm='?'
"**MENU_VE STARTUP CALL**
include_line 'INITIALIZE_USER_MENU ic=true nl=?$string($value(natural_language))?' status=osv$status
"**END MENU_VE VER 1.0**
END_COLLECT

  EDIT_FILE $fname(system_prolog) p=$null o=$null
    locate_text  text='"**MENU_VE STARTUP CALL**' status=local_status
    IF local_status.normal  THEN
      delete_text text='"**MENU_VE STARTUP CALL**'..'"**END MENU_VE VER 1.0**' status=ignore_status
    IFEND
    IF $value(automatic)  THEN
      read_file $fname(menu_startup_commands) p=after il=last
    IFEND
    write_file f=$fname(system_prolog//'.$NEXT')
  END no
  change_file_attributes $fname(system_prolog//'.$HIGH') ra=(3,13,13) status=ignore_status
  detach_file $fname(system_prolog//'.$HIGH') status=ignore_status
  detach_file $fname(menu_startup_commands) status=ignore_status

PROCEND change_menu_ve_activation


