! Help commands modified to use secondary help library for EVEplus commands ! so as to keep the text of the TPUHELP.HLB intact and unmodified, ! allowing for clean VMS updates. ! Modifications begun 23-JUN-1987 by A. Watson. ! Page 30 ! Top-level help command. Calls eve$help_keypad for keypad help, ! otherwise provides help on Eve commands. ! ! Parameters: ! ! first_topic String containing topic from command ! line - input procedure eve_help (first_topic) local this_topic, ! Topic name as typed by user lowercase_topic, ! Lowercase version of this_topic last_key_name, ! Keyword for last key after help prompt expand_result, ! String of possible Eve commands this_window, ! Current window showing_commands; ! True if showing Eve command list if current_window = info_window then unmap (info_window); position (eve$x_this_window); endif; this_window := current_window; this_topic := first_topic; map (info_window, help_buffer); last_key_name := "return"; message (eve$kt_null); loop eve$cleanse_string (this_topic); lowercase_topic := this_topic; change_case (lowercase_topic, lower); if lowercase_topic = "keypad" then eve$help_keypad; exitif 1; endif; if (last_key_name = "next_screen") or (last_key_name = "previous_screen") then execute (lookup_key (last_key, program)); update (info_window); else if (lowercase_topic = eve$kt_null) or (lowercase_topic = "?") or (lowercase_topic = "commands") then message (eve$kt_null); this_topic := "eve commands"; else expand_result := eve$parse (this_topic); if expand_result = eve$kt_null then this_topic := "eve commands"; else if index (expand_result, "(") = 0 then expand_result := substr (expand_result, 5, length (expand_result)); else expand_result := substr (expand_result, 5, index (expand_result, "(") - 5); endif; this_topic := "eve " + expand_result; endif; endif; if this_topic = "eve commands" then set (status_line, info_window, reverse, " Help buffer Press Next Screen or Prev Screen to see other commands"); if not showing_commands then eve$help_text (this_topic); endif; showing_commands := 1; else set (status_line, info_window, reverse, " Help buffer"); eve$help_text (this_topic); showing_commands := 0; endif; endif; if showing_commands then this_topic := read_line ("Type command you want help on (press Return if done): "); else this_topic := read_line ("Type command name, or ? for list (press Return if done): "); endif; eve$cleanse_string (this_topic); if this_topic = eve$kt_null then last_key_name := eve$lookup_comment (last_key); if (expand_result = "tpu") and (last_key_name = "do") then help_text ("tpuhelp", "vaxtpu", on, help_buffer); exitif 1; else exitif (last_key_name = "return") or (last_key_name = "do") or (last_key_name = "exit"); endif; else last_key_name := "return"; endif; endloop; unmap (info_window); position (this_window); eve$x_ambiguous_parse := 0; message (eve$kt_null); endprocedure; ! Page 31 ! Do help_text for a given topic, stripping librarian header information, ! and update the info_window. ! ! Parameters: ! ! topic String containing topic for VMS ! librarian - input procedure eve$help_text (topic) local this_range; ! Range to check for white-space on_error ! Invalid topic, do our best update (info_window); return; endon_error; help_text ("eveplushelp", topic, off, help_buffer); ! Look first in position (beginning_of (help_buffer)); ! EVEPLUS help lib this_range := search ("Sorry, no", forward); if this_range <> 0 then ! Help NOT found in EVEPLUSHELP.HLB help_text ("tpuhelp", topic, off, help_buffer); position (beginning_of (help_buffer)); endif; move_vertical (5); this_range := search (eve$pattern_whitespace, forward); ! error if not found if length (this_range) > 4 then ! allow indentation if desired move_horizontal (3); else move_horizontal (length (this_range) - 1); endif; erase (create_range (beginning_of (help_buffer), mark (none), none)); update (info_window); endprocedure; ! Page 32 ! Procedure to display keypad-oriented help. Called by eve_help. procedure eve$help_keypad local help_char, ! Keyword of key to provide help on which_topic, ! String with help library subtopic showing_keypad; ! True if currently displaying keypad diagram which_topic := eve$x_null; set (status_line, info_window, reverse, " Help buffer"); set (text, info_window, no_translate); eve$help_text ("keypad_diagrams eveplus"); position(beginning_of(current_buffer)); ! Get rid of the topic lines erase_line; erase_line; erase_line; erase_line; erase_line; ! Now delete the 5 spaces at the beginning of each line loop exitif mark(none) = end_of(current_buffer); erase_character(5); move_vertical(1); endloop; erase_line; position(beginning_of(current_buffer)); erase_line; showing_keypad := 1; loop if showing_keypad then help_char := eve$prompt_key ("Press key that you want help on (Return to leave help): "); else help_char := eve$prompt_key ("Press key that you want help on (Help for keypad, Return to leave help): "); endif; which_topic := eve$lookup_comment (help_char); exitif which_topic = "return"; if which_topic = eve$x_null then if eve$alphabetic (help_char) <> eve$x_null then which_topic := "typing"; else which_topic := "unknown"; endif; endif; if (which_topic = "help") and (not showing_keypad) then eve$help_text ("keypad_diagrams eveplus"); showing_keypad := 1; else eve$help_text ("eve " + which_topic); showing_keypad := 0; endif; endloop; endprocedure;