home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / DBRIEF.ZIP / SOURCE / ASSIST.M < prev    next >
Encoding:
Text File  |  1991-03-21  |  5.9 KB  |  220 lines

  1. ;dBRIEF Assist - v3.10
  2. ;Copyright (c) 1991 - Global Technologies Corporation
  3. ;ALL RIGHTS RESERVED
  4. #include "dbrief.h"
  5. (macro assi
  6.     (
  7.         (if (== (inq_assignment "_implode_object_window" 1) "")
  8.             (
  9.                 (= temp_str "")
  10.                 (message "Stand by...")
  11.                 (_pick_menu (search_path (inq_environment dbr_mnu_path) "assist.mnu") "Assist Menu" 47 (_menu_lines 25) 75 1)
  12.                 (if (&& (!= temp_str "NULL")(inq_macro (substr temp_str 1 (- (index temp_str " ")1))))
  13.                     (execute_macro temp_str)
  14.                 )
  15.             )
  16.         ;else
  17.             (_display_popup_message "Assist menu unavailable during object edit!" "" 1)
  18.         )
  19.     )
  20. )
  21. (macro dbhe
  22.     (
  23.         (if (== (inq_assignment "_implode_object_window" 1) "")
  24.             (
  25.                 (int                screen_lines
  26.                 )
  27.                 (= temp_str "")
  28.                 (while (!= temp_str "NULL")
  29.                     (
  30.                         (message "Stand by...")
  31.                         (_pick_menu (search_path (inq_environment dbr_mnu_path) "dbrief.mnu") "dBRIEF Help" 47 (_menu_lines 19) 75 1 "")
  32.                         (if (!= temp_str "NULL")
  33.                             (_display_dbhelp temp_str)
  34.                         )
  35.                     )
  36.                 )
  37.             )
  38.         ;else
  39.             (_display_popup_message "dBRIEF help unavailable during object edit!" "" 1)
  40.         )
  41.     )
  42. )
  43. (macro _display_dbhelp
  44.     (
  45.         (int        hlp_current_buffer
  46.                     hlp_temp_buffer
  47.                     hlp_start_block
  48.                     hlp_next_block
  49.         )
  50.         (string    topic
  51.         )
  52.         (= hlp_current_buffer (inq_buffer))
  53.         (if (= hlp_temp_buffer (create_buffer "dBRIEF Help" (search_path  (inq_environment dbr_mnu_path) "dbrief.hlp") 1))
  54.             (
  55.                 (set_buffer hlp_temp_buffer)
  56.                 (get_parm 0 topic)
  57.                 (top_of_buffer)
  58.                 (if (search_fwd (+ (+ "\xc" topic) "\xc"))
  59.                     (
  60.                         (keyboard_push)
  61.                         (beginning_of_line)
  62.                         (down)
  63.                         (inq_position hlp_start_block NULL)
  64.                         (search_fwd "\xc*\xc")
  65.                         (inq_position hlp_next_block NULL)
  66.                         (move_abs hlp_start_block 1)
  67.                         (if (>= (version) 310)
  68.                             (execute_macro "db_hide 0 _pick_action")
  69.                         )
  70.                         (if (> (- hlp_next_block hlp_start_block) 18)
  71.                             (create_window 2 21 76 2 "<PgUp/Dn> <N)ext/P)rev topic>, <Esc> to exit")
  72.                         ;else
  73.                             (create_window 2 21 76 2 "<N)ext/P)rev topic>, <Esc> to exit")
  74.                         )
  75.                         (if (>= (version) 310)
  76.                             (execute_macro "db_show 0")
  77.                         )
  78.                         (attach_buffer hlp_temp_buffer)
  79.                         (assign_to_key "<Keypad-minus>" "_exit")
  80.                         (assign_to_key "<P>" "_prev_topic")
  81.                         (assign_to_key "<N>" "_next_topic")
  82.                         (assign_to_key "<p>" "_prev_topic")
  83.                         (assign_to_key "<n>" "_next_topic")
  84.                         (assign_to_key "<Esc>" "exit")
  85.                         (assign_to_key "<PgUp>" "_prev_topic")
  86.                         (assign_to_key "<PgDn>" "_next_topic")
  87.                         (refresh)
  88.                         (process)
  89.                         (keyboard_pop)
  90.                         (delete_window)
  91.                         (search_back (+ (+ "\xc" topic) "\xc"))
  92.                         (beginning_of_line)
  93.                     )
  94.                 ;else
  95.                     (_display_popup_message "No help available for %s." (upper topic) 1)
  96.                 )
  97.                 (delete_buffer hlp_temp_buffer)
  98.             )
  99.         ;else
  100.             (_display_popup_message "Help file DBRIEF.HLP not found." "" 1)
  101.         )
  102.         (set_buffer hlp_current_buffer)
  103.         (attach_buffer hlp_current_buffer)
  104.     )
  105. )
  106. (macro _next_topic
  107.     (
  108.         (if (search_fwd "\xc\*\xc")
  109.             (
  110.                 (beginning_of_line)
  111.                 (down)
  112.             )
  113.         )
  114.     )
  115. )
  116. (macro _prev_topic
  117.     (
  118.         (int                hlp_line
  119.         )
  120.         (search_back "\xc\*\xc")
  121.         (inq_position hlp_line NULL)
  122.         (if (!= hlp_line 19)
  123.             (up)
  124.         )
  125.         (search_back "\xc\*\xc")
  126.         (beginning_of_line)
  127.         (down)
  128.     )
  129. )
  130. (macro inte
  131.     (
  132.         (int                int_current_buffer
  133.                             int_temp_buffer
  134.                             int_lines
  135.         )
  136.         (string            int_file_name
  137.         )
  138.         (inq_names int_file_name NULL NULL)
  139.         (if (inq_modified)
  140.             (write_buffer)
  141.         )
  142.         (= int_current_buffer (inq_buffer))
  143.         (= int_temp_buffer (create_buffer "Interface" (search_path  (inq_environment dbr_mnu_path) "interfac.cfg") 1))
  144.         (set_buffer int_temp_buffer)
  145.         (end_of_buffer)
  146.         (inq_position int_lines NULL)
  147.         (set_buffer int_current_buffer)
  148.         (delete_buffer int_temp_buffer)
  149.         (_pick_menu (search_path (inq_environment dbr_mnu_path) "interfac.cfg") "Interface" 30 (_menu_lines (+ int_lines 2)) 62 04)
  150.         (if (== (upper temp_str) "DBR_DIALECT")
  151.             (= temp_str (_get_dialect_info dbr_dialect 4))
  152.         )
  153.         (if (index (upper temp_str) "BUFFER")
  154.             (
  155.                 (= temp_str (substr temp_str 1 (- (index (upper temp_str) "BUFFER") 1)))
  156.                 (+= temp_str (+ " " int_file_name))
  157.             )
  158.         )
  159.         (drop_bookmark 1 "y")
  160.         (top_of_buffer)
  161.         (if (search_fwd (+ (_comment_character 3) " MAIN =") 0 0)
  162.             (
  163.                 (beginning_of_line)
  164.                 (= int_file_name (ltrim (trim (read))))
  165.                 (= int_file_name (trim (substr int_file_name (+ (index int_file_name "=") 1))))
  166.                 (+= temp_str (+ " " int_file_name))
  167.             )
  168.         )
  169.         (goto_bookmark 1)
  170.         (if (!= temp_str "NULL")
  171.             (dos temp_str)
  172.         )
  173.         (= temp_str "NULL")
  174.     )
  175. )
  176. (macro _execute_option_one
  177.     (
  178.         (int                int_current_buffer
  179.                             int_temp_buffer
  180.         )
  181.         (string            int_command_line
  182.                             int_file_name
  183.         )
  184.         (inq_names int_file_name NULL NULL)
  185.         (if (inq_modified)
  186.             (write_buffer)
  187.         )
  188.         (= int_current_buffer (inq_buffer))
  189.         (= int_temp_buffer (create_buffer "Interface" (search_path  (inq_environment dbr_mnu_path) "interfac.cfg") 1))
  190.         (set_buffer int_temp_buffer)
  191.         (move_abs 1 36)
  192.         (= int_command_line (ltrim (trim (read 29))))
  193.         (set_buffer int_current_buffer)
  194.         (delete_buffer int_temp_buffer)
  195.         (if (== (upper int_command_line) "DBR_DIALECT")
  196.             (= int_command_line (_get_dialect_info dbr_dialect 4))
  197.         )
  198.         (if (index (upper int_command_line) "BUFFER")
  199.             (
  200.                 (= int_command_line (substr int_command_line 1 (- (index (upper int_command_line) "BUFFER") 1)))
  201.                 (+= int_command_line (+ " " int_file_name))
  202.             )
  203.         )
  204.         (drop_bookmark 1 "y")
  205.         (top_of_buffer)
  206.         (if (search_fwd (+ (_comment_character 3) " MAIN =") 0 0)
  207.             (
  208.                 (beginning_of_line)
  209.                 (= int_file_name (ltrim (trim (read))))
  210.                 (= int_file_name (trim (substr int_file_name (+ (index int_file_name "=") 1))))
  211.                 (+= int_command_line (+ " " int_file_name))
  212.             )
  213.         )
  214.         (goto_bookmark 1)
  215.         (if (strlen int_command_line)
  216.             (dos int_command_line)
  217.         )
  218.     )
  219. )
  220.