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

  1. ;dBRIEF Setcmds - v3.10
  2. ;Copyright (c) 1991 - Global Technologies Corporation
  3. ;ALL RIGHTS RESERVED
  4. #include "dbrief.h"
  5. (macro setu
  6.     (
  7.         (if (== (inq_assignment "_implode_object_window" 1) "")
  8.             (
  9.                 (message "Please wait...")
  10.                 (string  _dbr_author
  11.                             _dbr_copyright
  12.                             _dbr_mem_lead
  13.                             _dbr_mem_trail
  14.                             _dbrief_dir
  15.                 )
  16.                 (int        box_buffer
  17.                 )
  18.                 (= dbr_current_buffer (inq_buffer))
  19.                 (= _dbrief_dir (search_path  (inq_environment "BPATH") "dbrief.h"))
  20.                 (= dbr_current_window (create_buffer "dbrief.h" _dbrief_dir 1))
  21.                 (= _dbr_author dbr_author)
  22.                 (= _dbr_copyright dbr_copyright)
  23.                 (= _dbr_mem_lead dbr_mem_lead)
  24.                 (= _dbr_mem_trail dbr_mem_trail)
  25.                 (= box_buffer (create_buffer "Setup" NULL 1))
  26.                 (set_buffer box_buffer)
  27.                 (insert "Text(1,1) \"        Auto Indent:\"\n")
  28.                 (if (== dbr_auto_indent 1)
  29.                     (insert "List(1,20) \"(On)Off\"\n")
  30.                 ;else
  31.                     (insert "List(1,20) \"On(Off)\"\n")
  32.                 )
  33.                 (insert "Text(2,1) \"        Auto Header:\"\n")
  34.                 (if (== dbr_auto_header 1)
  35.                     (insert "List(2,20) \"(On)Off\"\n")
  36.                 ;else
  37.                     (insert "List(2,20) \"On(Off)\"\n")
  38.                 )
  39.                 (insert "Text(3,1) \"        Default Ext:\"\n")
  40.                 (if (== dbr_set_ext 1)
  41.                     (insert "List(3,20) \"(On)Off\"\n")
  42.                 ;else
  43.                     (insert "List(3,20) \"On(Off)\"\n")
  44.                 )
  45.                 (insert "Text(4,1) \" Template editing:\"\n")
  46.                 (if (== dbr_template 1)
  47.                     (insert "List(4,20) \"(On)Off\"\n")
  48.                 ;else
  49.                     (insert "List(4,20) \"On(Off)\"\n")
  50.                 )
  51.                 (insert "Text(5,1) \" Language Dialect:\"\n")
  52.                 (sprintf temp_str "String(5,20) \"%s\"\n" (_get_dialect_info dbr_dialect 1))
  53.                 (insert temp_str)
  54.                 (insert "Text(6,1) \"     Graphics Mode:\"\n")
  55.                 (switch dbr_graphics
  56.                     1
  57.                         (insert "List(6,20) \"(Normal)Double\tCombination\tSpecial\"\n")
  58.                     2
  59.                         (insert "List(6,20) \"Normal(Double)Combination\tSpecial\"\n")
  60.                     3
  61.                         (insert "List(6,20) \"Normal\tDouble(Combination)Special\"\n")
  62.                     4
  63.                         (insert "List(6,20) \"Normal\tDouble\tCombination(Special)\"\n")
  64.                     NULL
  65.                         (insert "List(6,20) \"(Normal)Double\tCombination\tSpecial\"\n")
  66.                 )
  67.                 (insert "Text(7,1) \"        Comment tab:\"\n")
  68.                 (sprintf temp_str "Integer(7,20) \"%d\"\n" dbr_comment_tab)
  69.                 (insert temp_str)
  70.                 (insert "Text(8,1) \"             Library:\"\n")
  71.                 (sprintf temp_str "String(8,20) \"%s\"\n" dbr_library)
  72.                 (insert temp_str)
  73.                 (insert "Text(9,1) \" Comment line #'s:\"\n")
  74.                 (if (== dbr_comment_lines 1)
  75.                     (insert "List(9,20) \"(On)Off\"\n")
  76.                 ;else
  77.                     (insert "List(9,20) \"On(Off)\"\n")
  78.                 )
  79.                 (insert "Text(10,1) \" Procedure indent:\"\n")
  80.                 (if (== dbr_proc_indent 1)
  81.                     (insert "List(10,20) \"(On)Off\"\n")
  82.                 ;else
  83.                     (insert "List(10,20) \"On(Off)\"\n")
  84.                 )
  85.                 (insert "Text(11,1) \"                Author:\"\n")
  86.                 (sprintf temp_str "String(11,20) \"%s\"\n" _dbr_author)
  87.                 (insert temp_str)
  88.                 (insert "Text(12,1) \"            Copyright:\"\n")
  89.                 (sprintf temp_str "String(12,20) \"%s\"\n" _dbr_copyright)
  90.                 (insert temp_str)
  91.                 (insert "Text(13,1) \" Memvar lead char:\"\n")
  92.                 (sprintf temp_str "String(13,20) \"%s\"\n" _dbr_mem_lead)
  93.                 (insert temp_str)
  94.                 (insert "Text(14,1) \"Memvar trail char:\"\n")
  95.                 (sprintf temp_str "String(14,20) \"%s\"\n" _dbr_mem_trail)
  96.                 (insert temp_str)
  97.                 (_process_dialog_box 8 17 72 2 "dBRIEF Setup" " - -     F10 to save" NULL box_buffer "_action")
  98.                 (set_buffer dbr_current_buffer)
  99.                 (attach_buffer dbr_current_buffer)
  100.                 (delete_buffer dbr_current_window)
  101.                 (delete_buffer box_buffer)
  102.                 (call_registered_macro 6)
  103.                 (call_registered_macro 1)
  104.             )
  105.         ;else
  106.             (_display_popup_message "Setup unavailable during object edit!" "" 1)
  107.         )
  108.     )
  109. )
  110. (macro _action
  111.     (
  112.         (int        event_type
  113.                     line_no
  114.                     macro_buffer
  115.         )
  116.         (string  button_text
  117.                     _dbrief_dir
  118.         )
  119.         (get_parm 0 event_type)
  120.         (switch event_type
  121.             -8
  122.                 (
  123.                     (get_parm 1 line_no)
  124.                     (get_parm 2 button_text)
  125.                     (switch line_no
  126.                         1
  127.                             (switch button_text
  128.                                 "On"
  129.                                     (= dbr_auto_indent 1)
  130.                                 "Off"
  131.                                     (= dbr_auto_indent 0)
  132.                             )
  133.                         2
  134.                             (switch button_text
  135.                                 "On"
  136.                                     (= dbr_auto_header 1)
  137.                                 "Off"
  138.                                     (= dbr_auto_header 0)
  139.                             )
  140.                         3
  141.                             (switch button_text
  142.                                 "On"
  143.                                     (= dbr_set_ext 1)
  144.                                 "Off"
  145.                                     (= dbr_set_ext 0)
  146.                             )
  147.                         4
  148.                             (switch button_text
  149.                                 "On"
  150.                                     (= dbr_template 1)
  151.                                 "Off"
  152.                                     (= dbr_template 0)
  153.                             )
  154.                         6
  155.                             (switch button_text
  156.                                 "Normal"
  157.                                     (= dbr_graphics 1)
  158.                                 "Double"
  159.                                     (= dbr_graphics 2)
  160.                                 "Combination"
  161.                                     (= dbr_graphics 3)
  162.                                 "Special"
  163.                                     (= dbr_graphics 4)
  164.                                 NULL
  165.                                     (= dbr_graphics 1)
  166.                             )
  167.                         9
  168.                             (switch button_text
  169.                                 "On"
  170.                                     (= dbr_comment_lines 1)
  171.                                 "Off"
  172.                                     (= dbr_comment_lines 0)
  173.                             )
  174.                         10
  175.                             (switch button_text
  176.                                 "On"
  177.                                     (= dbr_proc_indent 1)
  178.                                 "Off"
  179.                                     (= dbr_proc_indent 0)
  180.                             )
  181.                     )
  182.                 )
  183.             -7
  184.                 (
  185.                     (get_parm 1 line_no)
  186.                     (get_parm 2 button_text)
  187.                     (switch line_no
  188.                         5
  189.                             (switch (upper button_text)
  190.                                 "CLIPPER"
  191.                                     (_switch_dialect dbr_dialect 1 0)
  192.                                 "FORCE"
  193.                                     (_switch_dialect dbr_dialect 2 0)
  194.                                 "DBASE3"
  195.                                     (_switch_dialect dbr_dialect 3 0)
  196.                                 "DBASE"    NULL
  197.                                 "DBASE4"
  198.                                     (_switch_dialect dbr_dialect 4 0)
  199.                                 "FOXBASE"
  200.                                     (_switch_dialect dbr_dialect 5 0)
  201.                                 "FOX"        NULL
  202.                                 "FOXPRO"
  203.                                     (_switch_dialect dbr_dialect 6 0)
  204.                                 "VULCAN"
  205.                                     (_switch_dialect dbr_dialect 7 0)
  206.                                 "QUICKSILVER"    NULL
  207.                                 "DBXL"
  208.                                     (_switch_dialect dbr_dialect 8 0)
  209.                                 "PARADOX"
  210.                                     (_switch_dialect dbr_dialect 9 0)
  211.                                 "RBASE"
  212.                                     (_switch_dialect dbr_dialect 10 0)
  213.                                 "SQL"
  214.                                     (_switch_dialect dbr_dialect 11 0)
  215.                                 "CLIPPER5"
  216.                                     (_switch_dialect dbr_dialect 12 0)
  217.                             )
  218.                         7
  219.                             (= dbr_comment_tab (atoi button_text))
  220.                         8
  221.                             (= dbr_library button_text)
  222.                         11
  223.                             (_change_header "dbr_author              " button_text 7)
  224.                         12
  225.                             (_change_header "dbr_copyright          " button_text 8)
  226.                         13
  227.                             (_change_header "dbr_mem_lead              " (trim button_text) 9)
  228.                         14
  229.                             (_change_header "dbr_mem_trail          " (trim button_text) 10)
  230.                     )
  231.                 )
  232.             -11
  233.                 (
  234.                     (message "Reconfiguring macro's, please wait...")
  235.                     (= _dbrief_dir (search_path (inq_environment "BPATH") "dbrief.m"))
  236.                     (= macro_buffer (create_buffer "dbrief.m" _dbrief_dir 1))
  237.                     (set_buffer macro_buffer)
  238.                     (if (search_fwd ";*** Default Settings" 0)
  239.                         (
  240.                             (move_rel 1 0)
  241.                             (_replace_source "        (= dbr_auto_indent %d)             ;*** auto indent ON=1, OFF=0" dbr_auto_indent)
  242.                             (move_rel 1 0)
  243.                             (_replace_source "        (= dbr_auto_header %d)             ;*** auto header ON=1, OFF=0" dbr_auto_header)
  244.                             (move_rel 1 0)
  245.                             (_replace_source "        (= dbr_set_ext %d)                 ;*** auto default extension ON=1, OFF=0" dbr_set_ext)
  246.                             (move_rel 1 0)
  247.                             (_replace_source "        (= dbr_template %d)                 ;*** template editing ON=1, OFF=0" dbr_template)
  248.                             (move_rel 1 0)
  249.                             (_replace_source "        (= dbr_dialect %02d)                 ;*** dialect code" dbr_dialect)
  250.                             (move_rel 1 0)
  251.                             (_replace_source "        (= dbr_graphics %d)                 ;*** graphics mode 1-Normal, 2-Double, 3-Special, 4-Combination" dbr_graphics)
  252.                             (move_rel 1 0)
  253.                             (_replace_source "        (= dbr_comment_tab %d)            ;*** comment tab column" dbr_comment_tab)
  254.                             (move_rel 1 0)
  255.                             (beginning_of_line)
  256.                             (delete_to_eol)
  257.                             (sprintf temp_str "         (= dbr_library \"%s\")  ;*** sourceview library" dbr_library)
  258.                             (insert temp_str)
  259.                             (move_rel 1 0)
  260.                             (_replace_source "        (= dbr_comment_lines %d)         ;*** conditional comment line numbers 1=ON, 0=OFF" dbr_comment_lines)
  261.                             (move_rel 1 0)
  262.                             (_replace_source "        (= dbr_proc_indent %d)             ;*** procedure/function indenting ON=1, OFF=0" dbr_proc_indent)
  263.                         )
  264.                     )
  265.                     (if (|| (inq_modified macro_buffer) (inq_modified dbr_current_window))
  266.                         (
  267.                             (if (inq_modified dbr_current_window)
  268.                                 (
  269.                                     (set_buffer dbr_current_window)
  270.                                     (write_buffer)
  271.                                     (_setup_compile (search_path (inq_environment "BPATH") "generate.m"))
  272.                                     (_setup_compile (search_path (inq_environment "BPATH") "setcmds.m"))
  273.                                     (_setup_compile (search_path (inq_environment "BPATH") "header.m"))
  274.                                     (_setup_compile (search_path (inq_environment "BPATH") "display.m"))
  275.                                 )
  276.                             )
  277.                             (if (inq_modified macro_buffer)
  278.                                 (
  279.                                     (set_buffer macro_buffer)
  280.                                     (write_buffer)
  281.                                 )
  282.                             )
  283.                             (_setup_compile (search_path (inq_environment "BPATH") "dbrief.m"))
  284.                         )
  285.                     )
  286.                     (set_buffer dbr_current_buffer)
  287.                     (delete_buffer macro_buffer)
  288.                 )
  289.         )
  290.         (return 1)
  291.     )
  292. )
  293. (macro _setup_compile
  294.     (
  295.         (string            _dbrief_macro
  296.         )
  297.         (get_parm 0 _dbrief_macro)
  298.         (message "Compiling %s." (upper _dbrief_macro))
  299.         (= _dbrief_macro (substr _dbrief_macro 1 (- (index (upper _dbrief_macro) ".M") 1)))
  300.         (sprintf temp_str "cm %s >&NUL" _dbrief_macro)
  301.         (dos temp_str)
  302.     )
  303. )
  304. (macro _replace_source
  305.     (
  306.         (int                replace_source_int
  307.         )
  308.         (string            replace_source_str
  309.                             replace_temp_str
  310.         )
  311.         (get_parm 0 replace_source_str)
  312.         (get_parm 1 replace_source_int)
  313.         (beginning_of_line)
  314.         (delete_to_eol)
  315.         (sprintf replace_temp_str replace_source_str replace_source_int)
  316.         (insert replace_temp_str)
  317.     )
  318. )
  319. (macro _change_header
  320.     (
  321.         (string            parm1_
  322.                             parm2_
  323.                             _change_str
  324.         )
  325.         (int                parm3_
  326.                             _change_buffer
  327.         )
  328.         (get_parm 0 parm1_)
  329.         (get_parm 1 parm2_)
  330.         (get_parm 2 parm3_)
  331.         (= _change_buffer (inq_buffer))
  332.         (set_buffer dbr_current_window)
  333.         (move_abs parm3_ 1)
  334.         (delete_to_eol)
  335.         (sprintf _change_str "#define  %s    \"%s\"" parm1_ parm2_)
  336.         (insert _change_str)
  337.         (set_buffer _change_buffer)
  338.     )
  339. )
  340. (macro set
  341.     (
  342.         (int                set_command_int
  343.         )
  344.         (string            set_command_str
  345.                             set_temp_str
  346.         )
  347.         (if (get_parm 0 set_command_str)
  348.             (switch (upper (substr set_command_str 1 4))
  349.                 "FUNC"    NULL
  350.                 "PROC"
  351.                     (if (get_parm 2 set_command_str "Procedure/function indenting [on/off]: ")
  352.                         (= dbr_proc_indent (_set_command_toggle "Procedure/function indenting is %s." set_command_str NULL NULL 1))
  353.                     )
  354.                 "COND"
  355.                     (if (get_parm 2 set_command_str "Conditional line #'s [on/off]: ")
  356.                         (= dbr_proc_indent (_set_command_toggle "Conditional line numbers are %s." set_command_str NULL NULL 1))
  357.                     )
  358.                 "DRAW"
  359.                     (if (get_parm 1 set_command_str "Graphics draw mode [on/off]: ")
  360.                         (if (== (upper set_command_str) "ON")
  361.                             (
  362.                                 (_cursor)
  363.                                 (_control_key)
  364.                             )
  365.                         ;else
  366.                             (_set_command_toggle "Graphics draw mode is %s." set_command_str "draw" "nodr" 0)
  367.                         )
  368.                     )
  369.                 "HEAD"
  370.                     (if (get_parm 1 set_command_str "Auto header [on/off]: ")
  371.                         (= dbr_auto_header (_set_command_toggle "Auto header is %s." set_command_str NULL NULL 1))
  372.                     )
  373.                 "EXTE"
  374.                     (if (get_parm 1 set_command_str "Default extension [on/off]: ")
  375.                         (
  376.                             (sprintf set_temp_str "Default extension of %s is " (_get_dialect_info dbr_dialect 3))
  377.                             (= dbr_set_ext (_set_command_toggle (+ set_temp_str "%s.") set_command_str NULL NULL 1))
  378.                         )
  379.                     )
  380.                 "TEMP"
  381.                     (if (get_parm 1 set_command_str "Template editing [on/off]: ")
  382.                         (= dbr_template (_set_command_toggle "Template editing is %s." set_command_str NULL NULL 1))
  383.                     )
  384.                 "INDE"
  385.                     (if (== (upper (get_parm 1 set_command_str)) "TO")
  386.                         (if (get_parm 2 set_command_int "Indent level: ")
  387.                             (
  388.                                 (= dbr_indent_level set_command_int)
  389.                                 (if (> dbr_indent_level 0)
  390.                                     (tabs (+ dbr_indent_level 1) (+ (* dbr_indent_level 2) 1))
  391.                                 )
  392.                                 (sprintf set_command_str "%d" dbr_indent_level)
  393.                                 (_display_popup_message "Indent level is %s." set_command_str 0)
  394.                             )
  395.                         )
  396.                     ;else
  397.                         (if (get_parm 1 set_command_str "Auto indent [on/off]: ")
  398.                             (= dbr_auto_indent (_set_command_toggle "Auto indenting is %s." set_command_str NULL NULL 1))
  399.                         )
  400.                     )
  401.                 "COMM"
  402.                     (if (get_parm 2 set_command_int "Comment tab: ")
  403.                         (
  404.                             (if (>= set_command_int 0)
  405.                                 (= dbr_comment_tab set_command_int)
  406.                             )
  407.                             (sprintf set_command_str "%d" dbr_comment_tab)
  408.                             (_display_popup_message "Comment tab is %s." set_command_str 0)
  409.                         )
  410.                     )
  411.                 "LIBR"
  412.                     (if (get_parm 2 set_command_str "Library [default=SRC]: ")
  413.                         (
  414.                             (if (index set_command_str ".")
  415.                                 (= set_command_str (+  (substr (upper set_command_str) 1 (index set_command_str ".")) "SRC"))
  416.                             ;else
  417.                                 (= set_command_str (+ (upper set_command_str) ".SRC"))
  418.                             )
  419.                             (if (exist set_command_str)
  420.                                 (
  421.                                     (= dbr_library set_command_str)
  422.                                     (= dbr_current_buffer (inq_buffer))
  423.                                     (= library_buffer (create_buffer "Library" dbr_library 1))
  424.                                     (set_buffer library_buffer)
  425.                                     (set_buffer dbr_current_buffer)
  426.                                     (_display_popup_message "Library set to %s." dbr_library 0)
  427.                                 )
  428.                             ;else
  429.                                 (_display_popup_message "Library %s not found!" set_command_str 1)
  430.                             )
  431.                         )
  432.                     )
  433.                 "GRAP"
  434.                     (if (get_parm 2 set_command_str "Graphics mode [norm/doub/spec/comb]: ")
  435.                         (
  436.                             (= temp_int dbr_graphics)
  437.                             (switch (substr (upper set_command_str) 1 4)
  438.                                 "NORM"
  439.                                     (= dbr_graphics 1)
  440.                                 "DOUB"
  441.                                     (= dbr_graphics 2)
  442.                                 "COMB"
  443.                                     (= dbr_graphics 3)
  444.                                 "SPEC"
  445.                                     (= dbr_graphics 4)
  446.                                 NULL
  447.                                     (= dbr_graphics 0)
  448.                             )
  449.                             (if (! (_display_graphics_mode dbr_graphics))
  450.                                 (
  451.                                     (_display_popup_message "Invalid argument - %s!" (upper set_command_str) 1)
  452.                                     (= dbr_graphics temp_int)
  453.                                 )
  454.                             )
  455.                         )
  456.                     )
  457.                 "DIAL"
  458.                     (if (get_parm 2 set_command_str "Dialect: ")
  459.                         (
  460.                             (message "Please wait...")
  461.                             (switch (upper set_command_str)
  462.                                 "CLIPPER"
  463.                                     (_switch_dialect dbr_dialect 1 1)
  464.                                 "FORCE"
  465.                                     (_switch_dialect dbr_dialect 2 1)
  466.                                 "DBASE3"
  467.                                     (_switch_dialect dbr_dialect 3 1)
  468.                                 "DBASE"    NULL
  469.                                 "DBASE4"
  470.                                     (_switch_dialect dbr_dialect 4 1)
  471.                                 "FOXBASE"
  472.                                     (_switch_dialect dbr_dialect 5 1)
  473.                                 "FOX"        NULL
  474.                                 "FOXPRO"
  475.                                     (_switch_dialect dbr_dialect 6 1)
  476.                                 "VULCAN"
  477.                                     (_switch_dialect dbr_dialect 7 1)
  478.                                 "QUICKSILVER"    NULL
  479.                                 "DBXL"
  480.                                     (_switch_dialect dbr_dialect 8 1)
  481.                                 "PARADOX"
  482.                                     (_switch_dialect dbr_dialect 9 1)
  483.                                 "RBASE"
  484.                                     (_switch_dialect dbr_dialect 10 1)
  485.                                 "SQL"
  486.                                     (_switch_dialect dbr_dialect 11 1)
  487.                                 "CLIPPER5"
  488.                                     (_switch_dialect dbr_dialect 12 1)
  489.                                 NULL
  490.                                     (_display_popup_message "Dialect %s is not a supported language!" (upper set_command_str) 1)
  491.                             )
  492.                         )
  493.                     )
  494.             )
  495.         ;else
  496.             (if (== (inq_assignment "_implode_object_window" 1) "")
  497.                 (_status)
  498.             ;else
  499.                 (_display_popup_message "Setup unavailable during object edit!" "" 1)
  500.             )
  501.         )
  502.     )
  503. )
  504. (macro _set_command_toggle
  505.     (
  506.         (int                _set_command_dis
  507.         )
  508.         (string            _set_command_str
  509.                             _set_command_msg
  510.                             _set_command_ex0
  511.                             _set_command_ex1
  512.         )
  513.         (get_parm 0 _set_command_msg)
  514.         (get_parm 1 _set_command_str)
  515.         (get_parm 3 _set_command_ex1)
  516.         (get_parm 4 _set_command_dis)
  517.         (= _set_command_str (upper _set_command_str))
  518.         (if (index "ON~OFF~" _set_command_str)
  519.             (if _set_command_dis
  520.                 (_display_popup_message _set_command_msg _set_command_str 0)
  521.             )
  522.         ;else
  523.             (_display_popup_message "Invalid argument - %s!" _set_command_str 1)
  524.         )
  525.         (if (&& (== _set_command_str "ON") (get_parm 2 _set_command_ex0))
  526.             (execute_macro _set_command_ex0)
  527.         )
  528.         (if (&& (== _set_command_str "OFF") (get_parm 3 _set_command_ex1))
  529.             (execute_macro _set_command_ex1)
  530.         )
  531.         (if (== _set_command_str "ON")
  532.             (returns 1)
  533.         ;else
  534.             (returns 0)
  535.         )
  536.     )
  537. )
  538. (macro _switch_dialect
  539.     (
  540.         (int            current_dialect
  541.                         new_dialect
  542.                         display_message
  543.         )
  544.         (get_parm 0 current_dialect)
  545.         (get_parm 1 new_dialect)
  546.         (get_parm 2 display_message)
  547.         (if (!= current_dialect new_dialect)
  548.             (
  549.                 (set_msg_level 3)
  550.                 (delete_macro (search_path (inq_environment "BPATH") (+ (lower (_get_dialect_info new_dialect 2)) ".CM")))
  551.                 (if (> (load_macro (lower (_get_dialect_info new_dialect 2))) 0)
  552.                     (
  553.                         (= dbr_dialect new_dialect)
  554.                         (if display_message
  555.                             (_display_popup_message "Dialect is %s." (_get_dialect_info dbr_dialect 1) 0)
  556.                         )
  557.                     )
  558.                 ;else
  559.                     (
  560.                         (load_macro (lower (_get_dialect_info dbr_dialect 2)))
  561.                         (if display_message
  562.                             (_display_popup_message "Unable to load %s support, previous dialect reinstated!" (_get_dialect_info new_dialect 1) 1)
  563.                         )
  564.                     )
  565.                 )
  566.                 (set_msg_level 0)
  567.             )
  568.         ;else
  569.             (if display_message
  570.                 (_display_popup_message "Dialect already is %s." (_get_dialect_info dbr_dialect 1) 1)
  571.             )
  572.         )
  573.     )
  574. )
  575.