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

  1. ;dBRIEF Application Express - v3.10
  2. ;Copyright (c) 1990 - Global Technologies Corporation
  3. ;ALL RIGHTS RESERVED
  4. #include "dbrief.h"
  5. (macro apx
  6.     (
  7.         (int                apx_menu_flag
  8.                             apx_temp_buffer
  9.         )
  10.         (if (== (inq_assignment "_implode_object_window" 1) "")
  11.             (
  12.                 (message "Stand by...")
  13.                 (= apx_menu_flag 0)
  14.                 (while (!= apx_menu_flag 1)
  15.                     (
  16.                         (= apx_menu_flag 0)
  17.                         (_pick_menu (search_path (inq_environment dbr_mnu_path) "apx.mnu") "APX Menu" 42 12 75 02)
  18.                         (switch temp_str
  19.                             "NULL"
  20.                                 (= apx_menu_flag 1)
  21.                             NULL
  22.                                 (if (inq_macro (substr temp_str 1 (- (index temp_str " ")1)))
  23.                                     (= apx_menu_flag (execute_macro temp_str))
  24.                                 ;else
  25.                                     (_display_popup_message "Error processing APX.MNU macro request!" "" 1)
  26.                                 )
  27.                         )
  28.                     )
  29.                 )
  30.             )
  31.         ;else
  32.             (_display_popup_message "APX system unavailable during object edit!" "" 1)
  33.         )
  34.     )
  35. )
  36. ;***
  37. ;* apx file operations macros
  38. ;***
  39. (macro _build_apx_file
  40.     (
  41.         (string file_name)
  42.         (if (get_parm 0 file_name "APX File to Create [.apx-def]: ")
  43.             (
  44.                 (if (strlen file_name)
  45.                     (
  46.                         (if (! (index (upper file_name) ".APX"))
  47.                             (= file_name (+ (substr file_name 1 (- (rindex file_name ".") 1)) ".APX"))
  48.                         )
  49.                         (if (exist file_name)
  50.                             (
  51.                                 (_open_apx_file file_name)
  52.                                 (returns 0)
  53.                             )
  54.                         ;else
  55.                             (if (_create_apx_file (upper file_name))
  56.                                 (returns 0)
  57.                             )
  58.                         )
  59.                     )
  60.                 )
  61.             )
  62.         )
  63.     )
  64. )
  65. (macro _create_apx_file
  66.     (
  67.         (int                apx_temp_size
  68.                             apx_temp_buffer
  69.                             apx_return_value
  70.         )
  71.         (string            apx_temp_name
  72.                             apx_file_spec
  73.                             apx_file_name
  74.                             apx_file_path
  75.         )
  76.         (get_parm 0 apx_file_name)
  77.         (unregister_macro 6 "_call_first_packages")
  78.         (unregister_macro 1 "_call_on_packages")
  79.         (= apx_temp_buffer (inq_buffer))
  80.         (if (!= dbr_apx_file_id 0)
  81.             (
  82.                 (set_buffer dbr_apx_file_id)
  83.                 (if (inq_modified)
  84.                     (write_buffer)
  85.                 )
  86.                 (delete_buffer dbr_apx_file_id)
  87.                 (set_buffer apx_temp_buffer)
  88.                 (= dbr_apx_file_id 0)
  89.             )
  90.         )
  91.         (= dbr_apx_file_id (create_buffer "APX File" apx_file_name 1))
  92.         (if (get_parm 1 apx_file_spec (+ "File(s) to include in APX [*." (+ (_get_dialect_info dbr_dialect 3) " ok]: ")))
  93.             (
  94.                 (= apx_file_path (substr apx_file_spec 1 (rindex apx_file_spec "\\")))
  95.                 (file_pattern apx_file_spec)
  96.                 (while (find_file apx_temp_name apx_temp_size)
  97.                     (
  98.                         (message "Adding %s to %s dictionary..." (upper apx_temp_name) "APX")
  99.                         (= apx_return_value (_create_apx_program 1 (upper (+ apx_file_path apx_temp_name))))
  100.                     )
  101.                 )
  102.                 (set_buffer dbr_apx_file_id)
  103.                 (write_buffer)
  104.             )
  105.         )
  106.         (if (== 0 apx_return_value)
  107.             (
  108.                 (delete_buffer dbr_apx_file_id)
  109.                 (_display_popup_message "Cannot create APX no matching files found!" "" 1)
  110.                 (= dbr_apx_file_id 0)
  111.             )
  112.         )
  113.         (register_macro 6 "_call_first_packages")
  114.         (register_macro 1 "_call_on_packages")
  115.         (set_buffer apx_temp_buffer)
  116.         (attach_buffer apx_temp_buffer)
  117.         (return apx_return_value)
  118.     )
  119. )
  120. (macro _open_apx_file
  121.     (
  122.         (string            apx_file_name
  123.         )
  124.         (if (get_parm 0 apx_file_name "APX file [APX default]: ")
  125.             (
  126.                 (= apx_file_name (upper apx_file_name))
  127.                 (if (! (index apx_file_name ".APX"))
  128.                     (if (index apx_file_name ".")
  129.                         (= apx_file_name (+ (substr apx_file_name 1 (- (index apx_file_name ".") 1)) ".APX"))
  130.                     ;else
  131.                         (= apx_file_name (+ apx_file_name ".APX"))
  132.                     )
  133.                 )
  134.                 (if (exist apx_file_name)
  135.                     (
  136.                         (= apx_file_name (upper apx_file_name))
  137.                         (= temp_int (inq_buffer))
  138.                         (if (!= dbr_apx_file_id 0)
  139.                             (
  140.                                 (set_buffer dbr_apx_file_id)
  141.                                 (if (inq_modified)
  142.                                     (write_buffer)
  143.                                 )
  144.                                 (delete_buffer dbr_apx_file_id)
  145.                                 (set_buffer temp_int)
  146.                                 (= dbr_apx_file_id 0)
  147.                             )
  148.                         )
  149.                         (= dbr_apx_file_id (create_buffer "APX File" apx_file_name 1))
  150.                         (if (!= dbr_apx_file_id 0)
  151.                             (_display_popup_message "APX file %s is active." apx_file_name 0)
  152.                         ;else
  153.                             (
  154.                                 (_display_popup_message "Unable to open %s!" apx_file_name 1)
  155.                                 (= apx_file_name "")
  156.                                 (= dbr_apx_file_id 0)
  157.                             )
  158.                         )
  159.                     )
  160.                 ;else
  161.                     (
  162.                         (_display_popup_message "APX file %s not found!" apx_file_name 1)
  163.                         (= apx_file_name "")
  164.                         (= dbr_apx_file_id 0)
  165.                     )
  166.                 )
  167.             )
  168.         )
  169.     )
  170. )
  171. (macro _close_apx_file
  172.     (
  173.         (string            apx_file_name
  174.         )
  175.         (= temp_int (inq_buffer))
  176.         (if (!= dbr_apx_file_id 0)
  177.             (
  178.                 (_display_popup_message "APX file %s closed." (_get_apx_file) 0)
  179.                 (set_buffer dbr_apx_file_id)
  180.                 (if (inq_modified)
  181.                     (write_buffer)
  182.                 )
  183.                 (delete_buffer dbr_apx_file_id)
  184.                 (set_buffer temp_int)
  185.                 (= apx_file_name "")
  186.                 (= dbr_apx_file_id 0)
  187.             )
  188.         ;else
  189.             (_display_popup_message "APX file not open!" "" 1)
  190.         )
  191.         (return 0)
  192.     )
  193. )
  194. (macro _display_apx_file
  195.     (
  196.         (if (!= dbr_apx_file_id 0)
  197.             (_display_popup_message "APX application is %s." (_get_apx_file) 0)
  198.         ;else
  199.             (_display_popup_message "No APX application loaded." "" 0)
  200.         )
  201.         (return 0)
  202.     )
  203. )
  204. ;***
  205. ;* apx program operations macros
  206. ;***
  207. (macro _create_apx_program
  208.     (
  209.         (int                apx_temp_buffer
  210.                             apx_temporary_buffer
  211.                             apx_build_flag
  212.                             apx_return_value
  213.                             apx_in_memory
  214.         )
  215.         (string            apx_program_name
  216.                             apx_full_name
  217.                             apx_program_description
  218.                             apx_format_string
  219.                             apx_t_date
  220.                             apx_t_time
  221.                             apx_num_lines
  222.                             apx_num_characters
  223.         )
  224.         (get_parm 0 apx_build_flag)
  225.         (= apx_temp_buffer (inq_buffer))
  226.         (if (!= dbr_apx_file_id 0)
  227.             (
  228.                 (if (&& (! (get_parm 1 apx_program_name))(edit_file))
  229.                     (
  230.                         (inq_names apx_program_name NULL NULL)
  231.                         (delete_buffer (inq_buffer))
  232.                     )
  233.                 )
  234.                 (if (&& (strlen apx_program_name)(!= apx_program_name "NULL"))
  235.                     (
  236.                         (set_buffer dbr_apx_file_id)
  237.                         (top_of_buffer)
  238.                         (if (index apx_program_name "\\")
  239.                             (= apx_full_name apx_program_name)
  240.                         ;else
  241.                             (
  242.                                 (getwd NULL apx_full_name)
  243.                                 (+= apx_full_name (+ "\\" apx_program_name))
  244.                             )
  245.                         )
  246.                         (if (search_fwd apx_full_name 0 1)
  247.                             (_display_popup_message "File %s already in APX dictionary!" apx_program_name 1)
  248.                         ;else
  249.                             (
  250.                                 (= apx_in_memory (edit_file apx_program_name))
  251.                                 (inq_names NULL NULL apx_program_name)
  252.                                 (= apx_temporary_buffer (inq_buffer))
  253.                                 (if apx_build_flag
  254.                                     (= apx_program_description (+ (_pad_right apx_program_name 13) "(no description)"))
  255.                                 ;else
  256.                                     (
  257.                                         (get_parm 2 apx_program_description "Program desc: " 35)
  258.                                         (if (== (strlen apx_program_description) 0)
  259.                                             (= apx_program_description "(no description)")
  260.                                         )
  261.                                     )
  262.                                 )
  263.                                 (set_buffer dbr_apx_file_id)
  264.                                 (if (&& (!= apx_in_memory 1) (== apx_build_flag 1))
  265.                                     (delete_buffer apx_temporary_buffer)
  266.                                 )
  267.                                 (end_of_buffer)
  268.                                 (search_back ";")
  269.                                 (move_rel 1 0)
  270.                                 (beginning_of_line)
  271.                                 (sprintf apx_format_string "%s;%s|%s\n" (_pad_right apx_program_description 35) (upper (_pad_right apx_program_name 12)) (upper apx_full_name))
  272.                                 (insert apx_format_string)
  273.                                 (write_buffer)
  274.                                 (= apx_return_value 1)
  275.                                 (if (! apx_build_flag)
  276.                                     (_display_popup_message "%s has been added to APX dictionary." (upper apx_program_name) 0)
  277.                                 )
  278.                             )
  279.                         )
  280.                     )
  281.                 )
  282.             )
  283.         ;else
  284.             (_display_popup_message "APX file not loaded!" "" 1)
  285.         )
  286.         (set_buffer apx_temp_buffer)
  287.         (attach_buffer apx_temp_buffer)
  288.         (return apx_return_value)
  289.     )
  290. )
  291. (macro _delete_apx_program
  292.     (
  293.         (string            apx_program_name
  294.                             dict_delete
  295.                             dict_delete_prompt
  296.                             file_delete
  297.                             file_delete_prompt
  298.         )
  299.         (if (!= dbr_apx_file_id 0)
  300.             (
  301.                 (= apx_program_name (_apx_prg_menu "  ─┘ to DELETE"))
  302.                 (if (&& (strlen apx_program_name)(!= apx_program_name "NULL"))
  303.                     (
  304.                         (= temp_int (inq_buffer))
  305.                         (set_buffer dbr_apx_file_id)
  306.                         (top_of_buffer)
  307.                         (beginning_of_line)
  308.                         (if (search_fwd apx_program_name 0 0)
  309.                             (
  310.                                 (move_abs 0 37)
  311.                                 (= apx_program_name (read))
  312.                                 (= apx_program_name (trim (substr apx_program_name 1 12)))
  313.                                 (= dict_delete "N")
  314.                                 (sprintf dict_delete_prompt "Delete %s from %s, OK? [yN]: " (upper apx_program_name) (_get_apx_file))
  315.                                 (= file_delete "N")
  316.                                 (sprintf file_delete_prompt "Delete %s from disk? [yN]: " (upper apx_program_name))
  317.                                 (get_parm 0 dict_delete dict_delete_prompt 1 "N")
  318.                                 (get_parm 1 file_delete file_delete_prompt 1 "N")
  319.                                 (if (== (upper dict_delete) "Y")
  320.                                     (
  321.                                         (delete_line)
  322.                                         (write_buffer)
  323.                                     )
  324.                                 )
  325.                                 (set_buffer temp_int)
  326.                             )
  327.                         )
  328.                         (if (== (upper file_delete) "Y")
  329.                             (del apx_program_name)
  330.                         )
  331.                     )
  332.                 )
  333.             )
  334.         ;else
  335.             (_display_popup_message "APX file not loaded!" "" 1)
  336.         )
  337.         (return 0)
  338.     )
  339. )
  340. (macro _select_apx_program
  341.     (
  342.         (if (== (inq_assignment "_implode_object_window" 1) "")
  343.             (
  344.                 (string            apx_program_name
  345.                 )
  346.                 (if (!= dbr_apx_file_id 0)
  347.                     (
  348.                         (= apx_program_name (_apx_prg_menu "  Select File"))
  349.                         (if (!= apx_program_name "NULL")
  350.                             (
  351.                                 (edit_file apx_program_name)
  352.                                 (return 1)
  353.                             )
  354.                         )
  355.                     )
  356.                 ;else
  357.                     (_display_popup_message "APX file not loaded!" "" 1)
  358.                 )
  359.             )
  360.         ;else
  361.             (_display_popup_message "APX system unavailable during object edit!" "" 1)
  362.         )
  363.         (return 0)
  364.     )
  365. )
  366. (macro _modify_apx_program
  367.     (
  368.         (string            apx_program_name
  369.                             apx_new_description
  370.         )
  371.         (if (!= dbr_apx_file_id 0)
  372.             (
  373.                 (= apx_program_name (_apx_prg_menu "  ─┘ to MODIFY"))
  374.                 (if (!= apx_program_name "NULL")
  375.                     (
  376.                         (if (get_parm 0 apx_new_description "Program desc: " 35)
  377.                             (
  378.                                 (if (== (strlen apx_new_description) 0)
  379.                                     (= apx_new_description "(no description)")
  380.                                 )
  381.                                 (= temp_int (inq_buffer))
  382.                                 (set_buffer dbr_apx_file_id)
  383.                                 (top_of_buffer)
  384.                                 (search_fwd apx_program_name 0 1)
  385.                                 (beginning_of_line)
  386.                                 (drop_anchor)
  387.                                 (move_rel 0 34)
  388.                                 (cut)
  389.                                 (insert (_pad_right apx_new_description 35))
  390.                                 (write_buffer)
  391.                                 (set_buffer temp_int)
  392.                             )
  393.                         )
  394.                     )
  395.                 )
  396.             )
  397.         ;else
  398.             (_display_popup_message "APX file not loaded!" "" 1)
  399.         )
  400.         (return 0)
  401.     )
  402. )
  403. (macro _apx_prg_menu
  404.     (
  405.         (int                apx_menu_buffer
  406.                             apx_current_buffer
  407.                             apx_menu_lines
  408.         )
  409.         (string            apx_menu_prompt
  410.                             apx_program_description
  411.         )
  412.         (get_parm 0 apx_menu_prompt)
  413.         (= apx_current_buffer (inq_buffer))                    ;save the buffer id of the current prg
  414.         (save_position)                                            ;save the current buffer's position
  415.         (set_buffer dbr_apx_file_id)                            ;switch to the apx dictionary
  416.         (top_of_buffer)                                            ;start at the top of the data dictionary
  417.         (= apx_menu_buffer (create_buffer "APX Menu" NULL 1))
  418.         (= apx_menu_lines 0)
  419.         (while (&& (search_fwd ";" 1 0)(! (inq_kbd_char)))
  420.             (
  421.                 (beginning_of_line)
  422.                 (= apx_program_description (trim(read)))
  423.                 (sprintf apx_program_description "%s %s ..;%s|\n" (substr apx_program_description 1 35) (substr apx_program_description 37 12) (substr apx_program_description 50))
  424.                 (set_buffer apx_menu_buffer)
  425.                 (insert apx_program_description)
  426.                 (++ apx_menu_lines)
  427.                 (set_buffer dbr_apx_file_id)
  428.                 (move_rel 1 0)
  429.                 (move_abs 0 1)
  430.             )
  431.         )
  432.         (keyboard_flush)
  433.         (set_buffer apx_menu_buffer)
  434.         (end_of_buffer)
  435.         (delete_line)
  436.         (top_of_buffer)
  437.         (set_buffer apx_current_buffer)
  438.         (restore_position)
  439.         (= temp_str "NULL")
  440.         (_pick_menu "" "" 20 (_menu_lines (+ apx_menu_lines 1)) 70 03 "_apx_prg_select" apx_menu_buffer (+ (+ (_get_apx_file) " ") apx_menu_prompt))
  441.         (returns temp_str)
  442.     )
  443. )
  444. (macro _apx_prg_select
  445.     (
  446.         (int                apx_event_type
  447.                             menu_line
  448.         )
  449.         (get_parm 0 apx_event_type)
  450.         (get_parm 1 temp_str)
  451.         (= temp_str (substr temp_str 53))
  452.         (switch apx_event_type
  453.             45             NULL
  454.             27
  455.                 (
  456.                     (= temp_str "NULL")
  457.                     (exit)
  458.                 )
  459.             13
  460.                 (
  461.                     (= temp_str (trim (substr temp_str 1 (- (index temp_str "|") 1))))
  462.                     (exit)
  463.                 )
  464.             02        NULL
  465.             03        NULL
  466.             00        NULL
  467.             01
  468.                 (
  469.                     (= temp_str (trim (substr temp_str 1 (- (index temp_str "|") 1))))
  470.                     (message "Pick - %s" temp_str)
  471.                 )
  472.         )
  473.         (return 1)
  474.     )
  475. )
  476. ;***
  477. ;* apx scanner operations
  478. ;***
  479. (macro _scan_apx_programs_r
  480.     (
  481.         (if (!= dbr_apx_file_id 0)
  482.             (return (_apx_scan_menu (+ "<" (_beg_of_rout_scan)) "Routines"))
  483.         ;else
  484.             (_display_popup_message "APX file not loaded!" "" 1)
  485.         )
  486.     )
  487. )
  488. (macro _scan_apx_programs_p
  489.     (
  490.         (if (!= dbr_apx_file_id 0)
  491.             (return (_apx_scan_menu (+ "<" (_beg_of_proc_scan)) "Procedures"))
  492.         ;else
  493.             (_display_popup_message "APX file not loaded!" "" 1)
  494.         )
  495.     )
  496. )
  497. (macro _scan_apx_programs_f
  498.     (
  499.         (if (!= dbr_apx_file_id 0)
  500.             (return (_apx_scan_menu (+ "<" (_beg_of_func_scan)) "Functions"))
  501.         ;else
  502.             (_display_popup_message "APX file not loaded!" "" 1)
  503.         )
  504.     )
  505. )
  506. (macro _scan_apx_programs_t
  507.     (
  508.         (if (!= dbr_apx_file_id 0)
  509.             (return (_apx_scan_menu NULL))
  510.         ;else
  511.             (_display_popup_message "APX file not loaded!" "" 1)
  512.         )
  513.     )
  514. )
  515. (macro _apx_scan_menu
  516.     (
  517.         (extern            _reg_exp
  518.         )
  519.         (int                apx_scan_buffer
  520.                             apx_program_buffer
  521.                             apx_program_line
  522.                             apx_temp_line
  523.                             apx_temp_col
  524.                             apx_menu_lines
  525.                             apx_not_in_memory
  526.         )
  527.         (string            apx_scan_line
  528.                             apx_program_description
  529.                             apx_program_name
  530.                             apx_current_file
  531.                             apx_routine_name
  532.                             apx_search_lbl
  533.                             apx_search_str
  534.         )
  535.         (if (get_parm 0 apx_search_str "Text to scan for: ")
  536.             (
  537.                 (if (! (get_parm 1 apx_search_lbl))
  538.                     (= apx_search_lbl (upper apx_search_str))
  539.                 )
  540.                 (inq_names apx_current_file NULL NULL)
  541.                 (save_position)                                            ;save the current buffer's position
  542.                 (top_of_buffer)
  543.                 (set_buffer dbr_apx_file_id)                            ;switch to the apx dictionary
  544.                 (top_of_buffer)                                            ;start at the top of the data dictionary
  545.                 (= apx_scan_buffer (create_buffer "APX Scan" NULL 1))
  546.                 (= apx_menu_lines 0)
  547.                 (while (&& (search_fwd ";" 1 0)(! (inq_kbd_char)))
  548.                     (
  549.                         (beginning_of_line)
  550.                         (= apx_program_description (read))
  551.                         (sprintf temp_str "%s  %s              |JUMP LIN0||%s\n" (substr apx_program_description 1 35) (_pad_right (substr apx_program_description 37 12) 12) (trim (substr apx_program_description 50)))
  552.                         (= apx_program_name (trim (substr apx_program_description 50)))
  553.                         (set_buffer apx_scan_buffer)
  554.                         (insert temp_str)
  555.                         (++ apx_menu_lines)
  556.                         (= apx_not_in_memory (edit_file apx_program_name))
  557.                         (= apx_program_buffer (inq_buffer))
  558.                         (inq_position apx_temp_line apx_temp_col)
  559.                         (top_of_buffer)
  560.                         (while (&& (search_fwd apx_search_str _reg_exp 0)(! (inq_kbd_char)))
  561.                             (
  562.                                 (beginning_of_line)
  563.                                 (= apx_routine_name (trim (ltrim (read))))
  564.                                 (if (strlen apx_routine_name)
  565.                                     (
  566.                                         (++ apx_menu_lines)
  567.                                         (message "Scanning for %s [#%d]..." apx_search_lbl apx_menu_lines)
  568.                                         (inq_position apx_program_line NULL)
  569.                                         (sprintf apx_scan_line " ->%05d: %s |JUMP LINE||%s\n" apx_program_line (substr (_pad_right apx_routine_name 48) 1 48) apx_program_name)
  570.                                         (set_buffer apx_scan_buffer)
  571.                                         (insert apx_scan_line)
  572.                                         (set_buffer apx_program_buffer)
  573.                                     )
  574.                                 )
  575.                                 (move_rel 1 0)
  576.                                 (move_abs 0 1)
  577.                             )
  578.                         )
  579.                         (keyboard_flush)
  580.                         (set_buffer apx_program_buffer)
  581.                         (move_abs apx_temp_line apx_temp_col)
  582.                         (set_buffer dbr_apx_file_id)
  583.                         (if (== apx_not_in_memory 2)
  584.                             (delete_buffer apx_program_buffer)
  585.                         )
  586.                         (move_rel 1 0)
  587.                         (move_abs 0 1)
  588.                     )
  589.                 )
  590.                 (keyboard_flush)
  591.                 (set_buffer apx_scan_buffer)
  592.                 (end_of_buffer)
  593.                 (delete_line)
  594.                 (top_of_buffer)
  595.                 (edit_file apx_current_file)
  596.                 (restore_position)
  597.                 (_pick_menu "" "" 20 (_menu_lines (+ apx_menu_lines 1)) 70 03 "_apx_scan_select" apx_scan_buffer (+ (+ "APX Scan: " (trim (substr apx_search_lbl 1 18))) "  <Grey - to Print>"))
  598.                 (if (!= temp_str "NULL")
  599.                     (
  600.                         (= apx_program_name (trim (substr temp_str 72)))
  601.                         (= apx_program_line (atoi (substr temp_str 4 5)))
  602.                         (edit_file apx_program_name)
  603.                         (if (index temp_str "JUMP LINE")
  604.                             (goto_line apx_program_line)
  605.                         ;else
  606.                             (top_of_buffer)
  607.                         )
  608.                         (return 1)
  609.                     )
  610.                 ;else
  611.                     (return 0)
  612.                 )
  613.             )
  614.         )
  615.     )
  616. )
  617. (macro _apx_scan_select
  618.     (
  619.         (int        apx_event_type
  620.         )
  621.         (get_parm 0 apx_event_type)
  622.         (get_parm 1 temp_str)
  623.         (switch apx_event_type
  624.             27
  625.                 (
  626.                     (= temp_int 0)
  627.                     (= temp_str "NULL")
  628.                     (exit)
  629.                 )
  630.             45
  631.                 (
  632.                     (translate "\\|JUMP*>" "" 1 1 0)
  633.                     (top_of_buffer)
  634.                     (insert "APX Scan Print\n")
  635.                     (insert "--------------------------------------------------------------------------\n")
  636.                     (insert "Line#  Source Line\n")
  637.                     (insert "-----  -------------------------------------------------------------------\n\n")
  638.                     (end_of_buffer)
  639.                     (insert "\n \n")
  640.                     (top_of_buffer)
  641.                     (drop_anchor)
  642.                     (end_of_buffer)
  643.                     (print)
  644.                     (= temp_int 0)
  645.                     (= temp_str "NULL")
  646.                     (exit)
  647.                 )
  648.             13
  649.                 (exit)
  650.             00        NULL
  651.             01
  652.                 (
  653.                     (if (index temp_str "JUMP LINE")
  654.                         (message "Jump to %s" (substr temp_str 3 35))
  655.                     ;else
  656.                         (message "Jump to line 1, %s" (trim (upper (substr temp_str 72))))
  657.                     )
  658.                 )
  659.         )
  660.         (return 1)
  661.     )
  662. )
  663. (macro _get_apx_file
  664.     (
  665.         (int                get_temp_buffer
  666.         )
  667.         (string            apx_id_file
  668.         )
  669.         (= apx_id_file "No APX File")
  670.         (if dbr_apx_file_id
  671.             (
  672.                 (= get_temp_buffer (inq_buffer))
  673.                 (set_buffer dbr_apx_file_id)
  674.                 (inq_names apx_id_file NULL NULL)
  675.                 (if (rindex apx_id_file "\\")
  676.                     (= apx_id_file (substr apx_id_file (+ (rindex apx_id_file "\\") 1)))
  677.                 )
  678.                 (set_buffer get_temp_buffer)
  679.             )
  680.         )
  681.         (returns (upper apx_id_file))
  682.     )
  683. )
  684.