home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / ME494-6.ZIP / SETUP.SRC < prev    next >
Encoding:
Text File  |  1990-06-08  |  107.7 KB  |  3,508 lines

  1. {******************************************************************************
  2.                                                 MULTI-EDIT MACRO FILE SETUP
  3.     Name:    SETUP
  4.  
  5. Description:    The installation and setup utilities
  6.  
  7. SETUP                        - The main Installation and Setup menu
  8. CHECK_SETUP            - Checks for changed configuration and prompts for saving
  9. KEYSPEED                - The key repeat speed menu
  10. SETEMS                    - Menu for configuring shell to DOS Ems and/or disk swapping
  11. SETEMSUSE                - Prompt for EMS for file data configuration
  12. SCRSTYLE                - The screen setup menu
  13. SETSAVE                    - Generates and compiles INIT.SRC to save settings
  14. SETKEYS                    - The key remapping menu
  15. DEFINE_KEY            - Prompts for key to define in SETKEYS
  16. SETCOLOR                - The color installation menu
  17. DISPLAY_SETUP        - The display configuration menu
  18. SRCHSET                    - The search configuration menu
  19. SETEDIT                    - The edit settings menu
  20. SETMEPATHS            - Sets up the backup methods, backup and temp file paths
  21. SETMOUSE                - The mouse settings menu
  22. PRTTYPE                    - The printer setup menu
  23. EXTENS                    - The filename extension specific setup menu
  24. PGM_DB                    - A menu of compiler interfaces for the selected extension
  25. PGM_WARNING            - Warns user of adding program types without support
  26. LANG_WARNING        - Warns user of adding language types without support
  27. EXT_FORMAT            - Creates and/or edits extension specific format lines.
  28. TGLVID                    - Toggles video mode
  29. KEYCODE                    - Get key1 and key2 scan codes for any keystroke
  30. MAKEKEY                    - Get key name from 2 scan codes
  31. BUILDKEY                - Converts a keystroke macro to a macro language statement
  32.  
  33.                              (C) Copyright 1989 by American Cybernetics, Inc.
  34. ******************************************************************************}
  35.  
  36. $MACRO SETUP TRANS;
  37. {******************************************************************************
  38.                                                              MULTI-EDIT MACRO
  39.  
  40.                              (C) Copyright 1989 by American Cybernetics, Inc.
  41. ******************************************************************************}
  42. {Global_Variables used:
  43.     Global_Int('Init_Window')   - The window for INIT.SRC
  44.     Global_Int('SETUP_X1')      - The upper left X coordinate of the setup menu
  45.     Global_Int('SETUP_Y1')      - The upper left Y coordinate of the setup menu
  46.     Global_Str('PRINTER_TYPE')  - The currently defined printer type
  47.     Global_Int('RESTORE')       - The restore flag
  48.     Global_Int('EMS_DEFAULT')   - The level of EMS support
  49. }
  50.     def_str( gstr[20], bstr[4] );
  51.     Def_Str(Menu_Str,Temp_String);
  52.     Def_Int(Jx,X1,Y1,J2,J3,Old_Ex,Temp_Insert,Temp_Window, old_refresh);
  53.  
  54. {initialize some variables, save some system variable values into temporary
  55. variables, etc.}
  56.     Undo_Stat := False;
  57.     Temp_Insert := Insert_Mode;
  58.     Push_Labels;
  59.     Flabel('Help',1,-1);
  60.     Old_Refresh := Refresh;
  61.     Refresh := False;
  62.     Messages := False;
  63.     Temp_Window := Cur_Window;
  64.     Ignore_Case := True;
  65.     JX := 1;
  66.     X1 := 2;
  67.     Y1 := 3;
  68.     Set_Global_Int('SETUP_X1',X1);
  69.     Set_Global_Int('SETUP_Y1',Y1);
  70.     Old_Ex := Explosions;
  71.  
  72.     gstr := Str(global_int('MENU_LEVEL')) + 'MSTR_';
  73.     bstr := '';
  74.  
  75.  
  76. {The main setup menu}
  77. Setup_Loop2:
  78.     if user_id <> '' then
  79.         temp_string := '(' + caps(user_id) + ')-';
  80.     else
  81.         temp_string := '';
  82.     end;
  83.  
  84.     Set_Global_Str('@INEV#1', '/T=Exit Setup/KC=<ESC>/K1=27/K2=1/R=0/W=15/X=' + str( x1 + 16 )
  85.                                     + '/Y=' + str( y1 + 19));
  86.  
  87.     Put_Box(X1,Y1,X1 + 51,Y1 + 20,0,m_b_color,temp_string + 'INSTALLATION AND SETUP',true);
  88.     Explosions := Old_Ex;
  89. Setup_Loop:
  90.     RM('CheckEvents /M=2/G=@INEV#/#=1');
  91.     {Write the DOS version}
  92. {Changed position 3-12-90 to accomodate a possible processor type being
  93. 80186/80188}
  94.     Write('DOS=',X1 + 1,Y1 + 1, 0, m_t_color);
  95.     Write(STR(DOS_VERSION AND $00FF) + '.' + STR(DOS_VERSION SHR 8),
  96.                 x1 + 5,y1 + 1, 0,m_s_color);
  97.  
  98.  
  99.     {Write the processor type}
  100.     IF Cpu = 0 THEN
  101.         Menu_Str := '8086/8088';
  102.     ELSIF Cpu = 1 THEN
  103.         Menu_Str := '80186/80188';
  104.     ELSIF Cpu = 2 THEN
  105.         Menu_Str := '80286';
  106.     ELSIF Cpu = 3 THEN
  107.         Menu_Str := '80386';
  108.     END;
  109. {Changed position 3-12-90 to accomodate a possible processor type being
  110. 80186/80188}
  111.     Write('CPU=',x1 + 11,y1 + 1,0,m_t_color);
  112.     Write(Menu_Str,x1 + 15,y1 + 1,0,m_s_Color);
  113.  
  114.     {Write the Video adapter type}
  115.     IF Video_Card = 0 THEN
  116.         Menu_Str := 'CGA';
  117.     ELSIF Video_Card = 1 THEN
  118.         Menu_Str := 'IBM Monochrome';
  119.     ELSIF Video_Card = 2 THEN
  120.         Menu_Str := 'MONROE Color';
  121.     ELSIF Video_Card = 3 THEN
  122.         Menu_Str := 'MONROE Mono.';
  123.     ELSIF Video_Card = 4 THEN
  124.         Menu_Str := 'SIGMA Color 400';
  125.     ELSIF Video_Card = 5 THEN
  126.         Menu_Str := 'EGA Color';
  127.     ELSIF Video_Card = 6 THEN
  128.         Menu_Str := 'Hercules Monochrome';
  129.     ELSIF Video_Card = 7 THEN
  130.         Menu_Str := 'VGA Monochrome';
  131.     ELSIF Video_Card = 8 THEN
  132.         Menu_Str := 'VGA Color';
  133.     ELSIF Video_Card = 9 THEN
  134.         Menu_Str := 'EGA Monochrome';
  135.     ELSIF Video_Card = 10 THEN
  136.         Menu_Str := 'Wyse 700';
  137.     ELSIF Video_Card = 11 THEN
  138.         Menu_Str := 'ATI EGA Wonder';
  139.     ELSE
  140.         Menu_str := 'CUSTOM';
  141.     END;
  142.     Write('Video Card = ',x1 + 1,y1 + 2,0,m_t_color);
  143.     Write(Menu_Str,x1 + 14,y1 + 2,0,m_s_color);
  144.  
  145.     Write('Expanded Memory ',x1 + 27,y1+1,0,m_t_color);
  146.     If ems_installed <> 0 then
  147.         R_AX := $4200;
  148.         INTR( $67 );
  149.         Write( '      ', x1 + 43, y1 + 1, 0, m_s_color );
  150.         Write( Str( (R_BX * $4000) / 1024 ) + 'k', x1 + 43, y1 + 1,0, m_s_color );
  151.     else
  152.         Write( 'N/A   ', x1 + 43, y1 + 1, 0, m_s_color );
  153.     end;
  154.  
  155.     {Write the path to find me files}
  156.     Write('ME Path = ',x1 + 1,y1+3,0,m_t_color);
  157.     Write( Copy(Me_Path,1,39), x1 + 11, y1 + 3, 0, m_s_color );
  158.     Write('────────────────────────────────────────────────', x1 + 1, y1 + 4, 0, m_b_color );
  159.  
  160. {Now build the main setup menu string}
  161. {Menu choices edit settings, colors, screen setup, and key remapping}
  162.     create_global_str(gstr + '1',
  163.         '/N=Edit settings...                                /M=SETEDIT');
  164.     create_global_str(gstr + '2',
  165.         '/N=Display setup...');
  166.     create_global_str(gstr + '3',
  167.         '/N=Key mapping.../M=SETKEYS');
  168.  
  169.     If Mouse Then
  170.         Menu_Str := 'On';
  171.     ELSE
  172.         Menu_Str := 'Off';
  173.     END;
  174.     create_global_str(gstr + '4',
  175.         '/N=Mouse...                  ^' + menu_str + '/S=3/M=SETMOUSE');
  176.  
  177. {Extensions}
  178.     create_global_str(gstr + '5',
  179.         '/N=Filename extensions.../M=EXTENS');
  180.  
  181.     Temp_String := Parse_Str('PT=',Global_Str('PRINTER_TYPE'));
  182.     If (Temp_String = '') Then
  183.         Temp_String := 'NONE';
  184.     End;
  185. {Printer}
  186.     create_global_str(gstr + '6',
  187.         '/S=3/N=Printer type...           ^' + Temp_String + '/M=PRTTYPE /X=4/Y=8');
  188.  
  189.     If (Global_Int('RESTORE')) Then
  190.         Temp_String := 'On';
  191.     ELSE
  192.         Temp_String := 'Off';
  193.     END;
  194.     create_global_str(gstr + '7',
  195.         '/N=Restore                   ^' + temp_string);
  196.  
  197. {EMS Support level}
  198.     IF swap_mode = 3 THEN
  199.         temp_string := 'Swap to EMS and Disk';
  200.     ELSIF swap_mode = 2 THEN
  201.         temp_string := 'Swap to EMS Only';
  202.     ELSIF swap_mode = 1 THEN
  203.         temp_string := 'Swap to Disk Only';
  204.     ELSIF swap_mode = 0 THEN
  205.         temp_string := 'No Swapping';
  206.     END;
  207.  
  208.     create_global_str(gstr + '8',
  209.         '/S=3/N=Shell to DOS method...    ^' + temp_string + '/M=SETEMS /Y=19');
  210.     j3 := Global_Int('@EMS_AMOUNT@');
  211.     If (j3 > 0) Then
  212.         Temp_String := 'Yes - ' + str(j3 * 64) + 'K';
  213.     ELSE
  214.         Temp_String := 'No';
  215.     END;
  216.  
  217.     create_global_str(gstr + '9',
  218.         '/S=3/N=Use EMS for editing...    ^' + temp_string);
  219.  
  220.     If File_Locking Then
  221.         Temp_String := 'On';
  222.     ELSE
  223.         Temp_String := 'Off';
  224.     END;
  225.     create_global_str(gstr + '10',
  226.         '/N=Network file locking      ^' + temp_string);
  227.  
  228.     create_global_str(gstr + '11',
  229.         '/N=Backups//Directories.../M=SETMEPATHS');
  230.  
  231.     create_global_str(gstr + '12','/N=|254');
  232.  
  233.     create_global_str(gstr + '13',
  234.         '/N=module//option Installation');
  235.  
  236.     create_global_str(gstr + '14',
  237.         '/N=saVe configuration and exit');
  238.  
  239. {Put up menu for selection}
  240.     RM('USERIN^SUBMENU /H=IN/GCLR=1/A=1/B=1/#=14/G=' + gstr +
  241.                                         '/X=' + str( x1 + 1) +
  242.                                         '/Y=' + str( y1 + 5) +
  243.                                         '/S=' + global_str( gstr + '0') +
  244.                                         '/BC=' + str(box_count)
  245.                         );
  246.  
  247.     IF (return_int < 1 ) THEN
  248.         IF check_key THEN
  249.             IF (key1 = 0) AND (key2 = 250) THEN
  250.                 RM('CheckEvents /M=1/G=@INEV#/#=1');
  251.                 IF (return_int <> 0) THEN
  252.                     return_int := parse_int('/R', return_str );
  253.                     IF return_int = 0 THEN
  254.                         goto save_exit;
  255.                     END;
  256.                 END;
  257.                 goto setup_loop2;
  258.             END;
  259.         END;
  260.         goto save_exit;
  261.     END;
  262.     jx := return_int;
  263.     IF JX = 2 THEN
  264.         RM( 'DISPLAY_SETUP /X=' + str( x1 + 5) + '/Y=' + str( y1 + 6) + '/BC=' + str(box_count - 1));
  265.         Old_Ex := Explosions;
  266.         IF return_int = 1000 THEN
  267.             refresh := true;
  268.             new_screen;
  269.             refresh := false;
  270.             goto setup_loop2;
  271.         END;
  272.         Goto Setup_Loop;
  273.     ELSIF (JX = 7) THEN
  274.         Set_GLobal_Int('RESTORE',NOT(Global_Int('RESTORE')));
  275.         call set_changed;
  276.     ELSIF (jx = 9) THEN
  277.         RM( 'SETEMSUSE /X=' + str( x1 + 2 ) + '/Y=' + str( y1 + 14 ) );
  278.     ELSIf (jx = 10) then
  279.         file_locking := not(file_locking);
  280.         call set_changed;
  281.     ELSIF (jx = 13) THEN
  282.         kill_box;
  283.         RM('MODINST');
  284.         goto setup_loop2;
  285.     ELSIf (jx = 14) then
  286.         RM('SETSAVE');
  287.         jx := 1;
  288.         goto save_exit2;
  289.     end;
  290.  
  291.     IF jx > 0 THEN
  292.         Goto Setup_Loop;
  293.     END;
  294.  
  295.  
  296. save_exit:
  297.  
  298.     jx := global_int( 'SETUP_CHANGED' );
  299.     rm( 'check_setup /X=10/Y=10');
  300.     IF return_int < 1 THEN
  301.         goto setup_loop;
  302.     END;
  303.  
  304. save_exit2:
  305. {Clean up and exit}
  306.     Kill_Box;
  307.     Kill_box;
  308.     IF (JX > 0) THEN
  309.         RM('SetScrn');
  310.     END;
  311.     New_Screen;
  312.     Messages := True;
  313.     Undo_Stat := True;
  314.     explosions := old_ex;
  315.     Goto Exit;
  316.  
  317. {********************************* SUBROUTINES *******************************}
  318.  
  319. set_changed:
  320.     Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  321.     RET;
  322.  
  323. EXIT:
  324.     RM('CheckEvents /M=3/G=@INEV#/#=1');
  325.     switch_window(temp_window);
  326.     Set_Global_Int('Init_Window',0);
  327.     Pop_Labels;
  328.     Insert_Mode := Temp_Insert;
  329.     Refresh := Old_Refresh;
  330.     Undo_Stat := True;
  331.     Explosions := Old_Ex;
  332.     return_int := 1;
  333. END_MACRO;
  334.  
  335. $MACRO CHECK_SETUP TRANS;
  336. {******************************************************************************
  337.                                                              MULTI-EDIT MACRO
  338.  
  339. Name:  CHECK_SETUP
  340.  
  341. Description:    Checks for configuration changed and prompts the user to save.
  342.  
  343. Parameters:
  344.                             /X=        X coordinate for menu box
  345.                             /Y=        Y coordinate for menu box
  346.  
  347.                              (C) Copyright 1989 by American Cybernetics, Inc.
  348. ******************************************************************************}
  349.  
  350.     def_int( x, y );
  351.     X := parse_int( '/X=', mparm_str );
  352.     Y := parse_int( '/Y=', mparm_str );
  353.     IF x = 0 THEN
  354.         x := 2;
  355.     END;
  356.     IF y = 0 THEN
  357.         y := 2;
  358.     END;
  359.     return_int := 1;
  360.     IF Global_Int('SETUP_CHANGED') THEN
  361.         Put_Box(x,y,x + 47, y + 4,0,m_b_color,'WARNING:  CONFIGURATION CHANGED',true);
  362.         Write('Exit without saving configuration settings?',x + 1, y + 1,0,m_s_color);
  363.  
  364.         RM('USERIN^XMENU /X=' + str( x + 8 ) +
  365.                                                         '/Y=' + str(y + 2 ) +
  366.                     '/S=1/M=No (IN)Yes ()Save settings and exit()');
  367.         Kill_Box;
  368.         IF return_int = 3 THEN
  369.     {Run the actual code generator and compiler}
  370.             RM( 'SETSAVE' );
  371.             If (Return_Str = 'COMP ERROR') Then
  372.                 return_int := 0;
  373.             ELSE
  374.                 return_int := 1;
  375.             End;
  376.         ELSIF return_int = 2 THEN
  377.             return_int := 1;
  378.         ELSE
  379.             return_int := 0;
  380.         END;
  381.     END;
  382.  
  383. END_MACRO;
  384.  
  385. $MACRO KEYSPEED TRANS;
  386. {******************************************************************************
  387.                                                              MULTI-EDIT MACRO
  388.  
  389. Name:    KEYSPEED
  390.  
  391. Description:    Makes use of the INTR interrupt command to set the keyboard
  392.                             typematic rate.  Will only work on machines with newer BIOS
  393.                             which support the INT $16, function 3.
  394.  
  395. Parameters:
  396.                             /X=        X coordinate for menu box
  397.                             /Y=        Y coordinate for menu box
  398.  
  399.  
  400.                              (C) Copyright 1989 by American Cybernetics, Inc.
  401. ******************************************************************************}
  402. {Global variables used:
  403.     Global_Int('IINT_1')    The following 8 globals are used to run the macro
  404.     Global_Str('IPARM_1')   DATA_IN which is part of the macro file MEUTIL2.
  405.     Global_Int('IINT_2')    A very thourough explanation of the usage of these
  406.     Global_Str('IPARM_2')   is explained in the source for this macro.
  407.     Global_Int('ISTR_2')
  408.     Global_Int('ISTR_1')
  409.  
  410.     Global_Int('KEYSPEED')  The currently defined key repeat speed
  411.     Global_Int('KEYDELAY')  The currently defined key repeat delay(from the time
  412.                                                     a key is pressed till key repeat begins)
  413.  
  414. }
  415.     Def_Int( speed, keydelay );
  416.     def_str( temp_return );
  417.     temp_return := return_str;
  418.  
  419.         {We'll use the DATA_IN macro to input the keyrepeat values}
  420.     Set_Global_Int( 'IINT_1', Global_Int('KEYSPEED') );
  421.     Set_Global_Str( 'IPARM_1', '/T=Repeat speed (0 = fastest, 31 = slowest):/C=2/L=1/W=3/TP=1' );
  422.     Set_Global_Int( 'IINT_2', Global_Int('KEYDELAY') );
  423.     Set_Global_Str( 'IPARM_2', '/T=Repeat delay (0 = least, 3 = most):/C=2/L=2/W=3/TP=1' );
  424.     RM( 'USERIN^Data_In /H=INEDKE/#=2/S=1/A=2/X=' + str(parse_int('/X=', mparm_str)) +
  425.                         '/Y=' + str(parse_int('/Y=', mparm_str)) + '/T=SETUP KEYBOARD REPEAT' );
  426.  
  427.     speed := Global_Int( 'IINT_1' );
  428.     keydelay := Global_Int( 'IINT_2' );
  429.  
  430.         {clean up globals}
  431.     Set_Global_Int( 'IINT_1', 0 );
  432.     Set_Global_Int( 'IINT_2', 0 );
  433.     Set_Global_Int( 'ISTR_2', 0 );
  434.     Set_Global_Int( 'ISTR_1', 0 );
  435.  
  436.     If (Speed < 0) or (speed > 31) or (keydelay < 0) or (keydelay > 3) THEN
  437.         RM('MEERROR^Beeps /C=1');
  438.         goto exit;
  439.     END;
  440.  
  441. {Set up the registers and do the interrupt}
  442.     IF (Global_Int('NO_KEYSPEED') = 0) THEN
  443.         R_BX := (keydelay shl 8) or speed;
  444.         R_AX := $0305;
  445.         INTR( $16 );
  446.     END;
  447. {Save the new current values into global variables}
  448.     Set_Global_Int('KEYSPEED', speed);
  449.     Set_Global_Int('KEYDELAY', keydelay);
  450. exit:
  451.     return_str := TEMP_RETURN;
  452.     return_int := 0;
  453. END_MACRO;
  454.  
  455. $MACRO SETUP_AUTO TRANS;
  456. {******************************************************************************
  457.                                                              MULTI-EDIT MACRO
  458.  
  459. Name:    SETUP_AUTO
  460.  
  461. Description:    Menu for setting up autosave for 2 autosave methods
  462.  
  463. Parameters:
  464.                             /X=        X coordinate for menu box
  465.                             /Y=        Y coordinate for menu box
  466.  
  467.  
  468.                              (C) Copyright 1989 by American Cybernetics, Inc.
  469. ******************************************************************************}
  470.     def_str( temp_return[20],M_Str[20] );
  471.     temp_return := return_str;
  472.  
  473.     Set_Global_Int('IINT_1', parse_int('/T1=', global_str('@AUTOSAVEPARMS')) );
  474.     Set_Global_Str('IPARM_1','/T=Seconds of keyboard inactivity (0 = OFF)..  /C=1/TP=1/W=3/L=1/MIN=0/MAX=254');
  475.     Set_Global_Int('IINT_2', parse_int('/S1=', global_str('@AUTOSAVEPARMS')) );
  476.     Set_Global_Str('ISTR_2','/T=YES/F=NO');
  477.     Set_Global_Str('IPARM_2','/T=Save complete editor status as well as files/C=1/L=2/W=3/TP=5');
  478.     Set_Global_Int('IINT_3', parse_int('/T2=', global_str('@AUTOSAVEPARMS')) );
  479.     Set_Global_Str('IPARM_3','/T=Absolute interval in seconds (0 = OFF)..    /C=1/TP=1/W=3/L=3/MIN=0/MAX=999');
  480.     Set_Global_Int('IINT_4', parse_int('/S2=', global_str('@AUTOSAVEPARMS')) );
  481.     Set_Global_Str('ISTR_4','/T=YES/F=NO');
  482.     Set_Global_Str('IPARM_4','/T=Save complete editor status as well as files/C=1/L=4/W=3/TP=5');
  483.     RM( 'USERIN^Data_In /H=INEDAU/#=4/S=1/A=2/X=' + str(parse_int('/X=', mparm_str)) +
  484.                         '/Y=' + str(parse_int('/Y=', mparm_str)) + '/T=SETUP AUTOSAVE' );
  485.  
  486.     RM('SetAutoSave /M2=1/T1=' + str( Global_Int( 'IINT_1' )) +
  487.             '/S1=' + str( Global_Int( 'IINT_2' )) +
  488.             '/T2=' + str( Global_Int( 'IINT_3' )) +
  489.             '/S2=' + str( Global_Int( 'IINT_4' )) +
  490.             '/H1=' + parse_Str('/H1=', global_str('@AUTOSAVEPARMS')) +
  491.             '/H2=' + parse_Str('/H2=', global_str('@AUTOSAVEPARMS')));
  492.  
  493. exit:
  494.     return_str := TEMP_RETURN;
  495.     return_int := 0;
  496. END_MACRO;
  497.  
  498. $MACRO SETEMS TRANS;
  499. {******************************************************************************
  500.                                                              MULTI-EDIT MACRO
  501.  
  502. Name:  SETEMS
  503.  
  504. Description:  Menu to configure shell to DOS swapping to ems and/or disk.
  505.  
  506. Parameters:
  507.                             /X=        X coordinate for menu box
  508.                             /Y=        Y coordinate for menu box
  509.  
  510.                              (C) Copyright 1989 by American Cybernetics, Inc.
  511. ******************************************************************************}
  512.  
  513.         def_int( x, y, t_es1, t_es );
  514.         x := Parse_Int('/X=', mparm_str );
  515.         y := Parse_Int('/Y=', mparm_str );
  516.         IF x = 0 THEN
  517.             x := 2;
  518.         END;
  519.         IF y = 0 THEN
  520.             y := 2;
  521.         END;
  522.  
  523.         {get individual flags(nybbles) by masking}
  524.  
  525.         Set_Global_Str('ISTR_1','No swap()swap to Disk only()swap to EMS only()Swap to EMS, then to disk()');
  526.         Set_Global_Int('IINT_1', swap_mode + 1 );
  527.         Set_Global_Str('IPARM_1','/T=Swap method:/C=1/TP=3/W=25/L=1');
  528.         Set_Global_Int('IINT_2', (swap_mem * 16) / 1024 );
  529.         Set_Global_Str('IPARM_2','/T=Maximum memory to free up (in K bytes; 0 = ALL):/C=1/W=6/TP=1/L=2');
  530.         Set_Global_Int('IINT_3', max_swap_ems * 16);
  531.         Set_Global_Str('IPARM_3','/T=Maximum expanded memory to use (in K bytes; 0 = ALL):/C=1/W=6/TP=1/L=3');
  532.  
  533.         RM('UserIn^Data_In /H=INSHELL/S=1/A=2/#=3/T=SHELL TO DOS // EMS SETUP/X=' + str(x) + '/Y=' + str(y));
  534.         swap_mode := Global_Int('IINT_1') - 1;
  535.         Swap_Mem := (Global_Int('IINT_2') * 1024) / 16;
  536.         Max_Swap_EMS := Global_Int('IINT_3') / 16;
  537.  
  538.         t_es := Global_Int('EMS_DEFAULT');
  539.  
  540.         t_es := t_es or 2;
  541.  
  542.     {Set global to new value}
  543.         Set_GLobal_Int('EMS_DEFAULT', t_es);
  544.         Ems_Stat := t_es;
  545.         Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  546. END_MACRO;
  547.  
  548.  
  549. $MACRO SETEMSUSE TRANS;
  550. {******************************************************************************
  551.                                                              MULTI-EDIT MACRO
  552.  
  553. Name:  SETEMSUSE
  554.  
  555. Description:  Promt to configure EMS use for file data.
  556.  
  557. Parameters:
  558.                             /X=        X coordinate for menu box
  559.                             /Y=        Y coordinate for menu box
  560.  
  561.                              (C) Copyright 1989 by American Cybernetics, Inc.
  562. ******************************************************************************}
  563.  
  564.         def_int( x, y, t_es1, t_es );
  565.         x := Parse_Int('/X=', mparm_str );
  566.         y := Parse_Int('/Y=', mparm_str );
  567.         IF x = 0 THEN
  568.             x := 2;
  569.         END;
  570.         IF y = 0 THEN
  571.             y := 2;
  572.         END;
  573.  
  574.         RETURN_INT := Global_Int('@EMS_AMOUNT@') * 64;
  575.         RM( 'USERIN^QUERYBOX /T=ENTER AMOUNT OF MEMORY IN K BYTES(0-16000, 0 = NONE)/P=Amount will be rounded to nearest 64K block:  /W=6/MAX=16000/MIN=0/N=1/L='
  576.                                 + str(y) + '/C=' + str(x));
  577.         IF Return_Str = 'TRUE' THEN
  578.             IF return_int = 0 THEN
  579.                 Set_Global_Int('@EMS_AMOUNT@', 0 );
  580.             ELSE
  581.                 Set_Global_Int('@EMS_AMOUNT@', (return_int + 63) / 64 );
  582.             END;
  583.             Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  584.         END;
  585. END_MACRO;
  586.  
  587.  
  588. $MACRO SCRSTYLE TRANS;
  589. {******************************************************************************
  590.                                                              MULTI-EDIT MACRO
  591.  
  592. Name:  SCRSTYLE
  593.  
  594. Description:  This is the Setup menu for the 2 screen configurations.
  595.  
  596. Parameters:
  597.                             /X=        X coordinate for menu box
  598.                             /Y=        Y coordinate for menu box
  599.  
  600.                              (C) Copyright 1989 by American Cybernetics, Inc.
  601. ******************************************************************************}
  602.  
  603. {Global variables used:
  604. Global_Int('SETUP_X1')  The X and Y coordinates of the upper left hand corner
  605. Global_Int('SETUP_Y1')  of the main installation and setup menu box
  606. Global_Int('DEF_SCRN_STYLE') The default screen configuration
  607. }
  608.     Def_Int(jx,DSS,x1,y1, j1, j2 , xa, sx,mx,fx, lb, rb, mb);
  609.     Def_Str( tstr, tstr2[80] );
  610.     Def_Char( style );
  611.  
  612.     X1 := parse_int('/X=', mparm_str );
  613.     Y1 := parse_int('/Y=', mparm_str );
  614.     IF x1 = 0 THEN
  615.         x1 := 2;
  616.     END;
  617.     IF y1 = 0 THEN
  618.         y1 := 2;
  619.     END;
  620.  
  621.  
  622.     Put_Box(x1,y1, x1 + 31, y1 + 3,
  623.                     0, m_b_color, 'SCREEN SETUP', true);
  624.     j1 := 1;
  625.     DSS := Global_Int('DEF_SCRN_STYLE');
  626.  
  627. Screen_Loop:
  628.     draw_char( 32, x1 + 1, y1 + 1, m_b_color, 28 );
  629.     If dss = 1 THEN
  630.         Tstr := 'layout A((default)(INSC)layout B()';
  631.     ELSE
  632.         If dss = 2 THEN
  633.             Tstr := 'layout A(INSC)layout B((default)()';
  634.         ELSE
  635.             Tstr := 'layout A(INSC)layout B()';
  636.         END;
  637.     END;
  638.  
  639.  
  640.  
  641.     RM('USERIN^XMENU /S=' + str( j1) +
  642.                 '/X=' + str( x1 + 2) +
  643.                 '/Y=' + str( y1 + 1) +
  644.                 '/M=' + Tstr);
  645.  
  646.     j1 := return_int;
  647.     if j1 > 0 then
  648.         xa := x1 + (j1 * 9) - 8;
  649.         style := Char(j1 + 64);
  650.         tstr2 := global_str('@SCREEN_SET' + style );
  651.         mx := parse_int('/M=', tstr2);
  652.         sx := parse_int('/S=', tstr2);
  653.         fx := parse_int('/F=', tstr2);
  654.         lb := parse_int('/LB=', tstr2);
  655.         rb := parse_int('/RB=', tstr2);
  656.         mb := parse_int('/MB=', tstr2);
  657.         jx := xpos('/MACRO=', tstr2, 1 );
  658.         if jx <> 0 then
  659.             tstr := shorten_str(copy( tstr2, jx + 7, 40 ));
  660.         else
  661.             tstr := '';
  662.         end;
  663.  
  664.         Set_Global_Int('IINT_1',dss = j1);
  665.         Set_Global_Str('ISTR_1','/T=YES/F=NO');
  666.         Set_Global_Str('IPARM_1','/T=Default................................./C=1/W=3/TP=5');
  667.         Set_Global_Int('IINT_2',sx);
  668.         Set_Global_Str('ISTR_2','/T=YES/F=NO');
  669.         Set_Global_Str('IPARM_2','/T=Status line............................./C=1/W=3/TP=5');
  670.         Set_Global_Int('IINT_3',mx);
  671.         Set_Global_Str('ISTR_3','/T=YES/F=NO');
  672.         Set_Global_Str('IPARM_3','/T=Message Line............................/C=1/W=3/TP=5');
  673.         Set_Global_Int('IINT_4',mb);
  674.         Set_Global_Str('ISTR_4','/T=YES/F=NO');
  675.         Set_Global_Str('IPARM_4','/T=Menu bar................................/C=1/W=3/TP=5');
  676.         Set_Global_Int('IINT_5',fx);
  677.         Set_Global_Str('ISTR_5','/T=YES/F=NO');
  678.         Set_Global_Str('IPARM_5','/T=Function key labels...................../C=1/W=3/TP=5');
  679.         Set_Global_Int('IINT_6',lb);
  680.         Set_Global_Str('ISTR_6','/T=YES/F=NO');
  681.         Set_Global_Str('IPARM_6','/T=Left-hand border on full screen window../C=1/W=3/TP=5');
  682.         Set_Global_Int('IINT_7',rb);
  683.         Set_Global_Str('ISTR_7','/T=YES/F=NO');
  684.         Set_Global_Str('IPARM_7','/T=Right-hand border on full screen window./C=1/W=3/TP=5');
  685.         Set_Global_Str('ISTR_8',tstr);
  686.         Set_Global_Str('IPARM_8','/T=Macro to run........../C=1/W=21/ML=80');
  687.         RM('UserIn^Data_In /H=INSC/S=1/A=2/#=8/T=LAYOUT ' + style +
  688.             '/Y=' + str(y1 + 2) + '/X=' + str(xa + 1));
  689.         set_global_str('@SCREEN_SET' + style,
  690.             '/F=' + str(global_int('IINT_5')) +
  691.             '/M=' + str(global_int('IINT_3')) +
  692.             '/S=' + str(global_int('IINT_2')) +
  693.             '/MB=' + str( global_int('IINT_4')) +
  694.             '/LB=' + str(global_int('IINT_6')) +
  695.             '/RB=' + str(global_int('IINT_7')) +
  696.             '/MACRO=' + global_str('ISTR_8') );
  697.         if global_int('IINT_1') then
  698.             dss := j1;
  699.         else
  700.             dss := j1 - 1;
  701.             if dss < 1 then
  702.                 dss := 2;
  703.             end;
  704.         end;
  705.         Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  706.         Goto Screen_Loop;
  707.     end;
  708. Exit:
  709.     Kill_Box;
  710.     Set_Global_Int('DEF_SCRN_STYLE', DSS);
  711.     return_int := 0;
  712. END_MACRO;
  713.  
  714.  
  715. $MACRO SETSAVE TRANS;
  716. {******************************************************************************
  717.                                                              MULTI-EDIT MACRO
  718.  
  719. NAME:  SETSAVE
  720.  
  721. DESCRIPTION:  This macro creates and compiles INIT.SRC to save all setup
  722.                             parameters
  723.  
  724.                              (C) Copyright 1989 by American Cybernetics, Inc.
  725. ******************************************************************************}
  726.  
  727. {
  728. Global Variables used:
  729. Global_Int('Init_Window')  The window where INIT.SRC is created.
  730. Plus a myriad of globals that get used to create INIT.SRC... much to numerous
  731. to be practical to mention here.
  732. }
  733.     Def_Str(
  734.                     Whole_Line,
  735.                     F_Label[20],
  736.                     TStr,
  737.                     Temp_Stuff,
  738.                     Extension[80],
  739.                     Temp_Global,
  740.                     Program
  741.                     );
  742.  
  743.     Def_Int(tid,Temp_Integer,Jx,Jy,T_Tab_Expand,T_Reg_Exp_Stat,Global_Count,
  744.                     P_Jx,P_Jy,T_Insert_Mode);
  745.     Def_Int(Active_Window,Keymap_Window,Macro_Window,Error_Window,
  746.                     Cmd, bc);
  747.     Def_Str(MStr[80],MName[30],KName[17],Mode_Str[10]);
  748.  
  749. {Initialize variables and save some system variables into temporary variables}
  750.     IF (Global_Str('@KEYMAP_NAME@') = '') THEN
  751.         Set_Global_Str('@KEYMAP_NAME@','KN=MULTI-EDITFN=KEYMAP');
  752.     END;
  753.     T_Reg_Exp_Stat := Reg_Exp_Stat;
  754.     T_Insert_Mode := Insert_Mode;
  755.     Return_Str := '';
  756.     Undo_Stat := False;
  757.     T_Tab_Expand := Tab_Expand;
  758.     Tab_Expand := False;
  759.     Insert_Mode := True;
  760.     Active_Window := Window_Id;
  761.     Switch_Window(Window_Count);
  762.     Create_Window;
  763.     Macro_Window := Window_Id;
  764.     Refresh := False;
  765.  
  766.     IF (Global_Int('SETUP_CHANGED') and $02) THEN
  767.  
  768.         Reg_Exp_Stat := False;
  769.         RM('MEERROR^MessageBox /B=0/NW=1/T=SAVING CONFIGURATION/M=Building Keymap macro...');
  770.     {    Make_Message('Building Keymap macro...'); }
  771.         return_str := Parse_Str('FN=',Global_Str('@KEYMAP_NAME@')) + '.DB';
  772.         RM('MakeUserPath /DF=1');
  773.         IF (Switch_File(Return_Str) = 0) THEN
  774.             Switch_Window(Window_Count);
  775.             Create_Window;
  776.             Load_File(Return_str);
  777.             IF (Error_Level) THEN
  778.                 RM('MEERROR^MESSAGEBOX /B=2/T=ERROR ' + Str(Error_Level) + '/M=Can''t find ' + Return_Str +
  779.                         '.  Install terminated.');
  780.                 Error_Level := 0;
  781.                 Goto END_OF_MAC;
  782.             END;
  783.         ELSE
  784.             Tof;
  785.             IF (File_Changed) THEN
  786.                 Error_Level := 0;
  787.                 Save_File;
  788.                 IF (Error_Level) THEN
  789.                     RM('MEERROR^MESSAGEBOX /B=2/T=ERROR ' + Str(Error_Level) + '/M=Can''t save ' + Return_Str +
  790.                             '.  Install terminated.');
  791.                     Error_Level := 0;
  792.                     Goto END_OF_MAC;
  793.                 END;
  794.             END;
  795.         END;
  796.  
  797.         Keymap_Window := Window_Id;
  798.         Switch_Win_Id(Macro_Window);
  799.         Return_Str := User_Id + 'KEYMAP.SRC';
  800.         RM('MakeUserPath');
  801.         File_Name := Return_Str;
  802.         PUT_LINE('$MACRO ' + USER_ID + 'KEYMAP DUMP;');
  803.         Insert_Mode := True;
  804.         Down;
  805.         Put_Line('{This macro was created by the Multi-Edit install macro version ' + Version + '}');
  806.         Down;
  807.         Down;
  808.         Put_Line('{Default key assignments}');
  809.         Down;
  810.         IF (Switch_Win_Id(Keymap_Window)) THEN
  811.         END;
  812.  
  813.         IF (Search_Fwd('****START****',0)) THEN
  814.             Down;
  815.             Goto_Col(1);
  816.         END;
  817.         WHILE (Not(At_Eof)) DO
  818.             TStr := Get_Line;
  819.             Down;
  820.             MName := Parse_Str('MC=',TStr);
  821.             IF (Mname <> '') THEN
  822.                 IF (Switch_Win_Id(Macro_Window)) THEN
  823.                     KName := Parse_Str('K1=',Tstr);
  824.                     IF (KName <> '') THEN
  825.                         Call Build_Key_Line;
  826.             mstr := Parse_Str('MID=', tstr );
  827.             IF mstr <> '' THEN
  828.               put_line('Set_Global_Str(''' + mstr + ''', ''' + kname + ''');');
  829.               DOWN;
  830.             END;
  831.                     END;
  832.                     KName := Parse_Str('K2=',Tstr);
  833.                     IF (KName <> '') THEN
  834.                         Call Build_Key_Line;
  835.                     END;
  836.  
  837.                     IF (Switch_Win_Id(Keymap_Window)) THEN
  838.                     END;
  839.                 END;
  840.             END;
  841.         END;
  842.         IF (Switch_Win_Id(Macro_Window)) THEN
  843.         END;
  844.         Down;
  845.         PUT_LINE('END_MACRO;');
  846.  
  847.         Save_File;
  848. {
  849.         Kill_Box;
  850. }
  851.         Call COMPILE;
  852.         IF (Return_Int) THEN
  853.             Return_Str := 'COMP ERROR';
  854.             Goto END_OF_MAC;
  855.         ELSE
  856.             IF (Switch_Win_Id(Keymap_Window)) THEN
  857.                 Delete_Window;
  858.             END;
  859.             IF (Switch_Win_Id(Active_Window)) THEN
  860.             END;
  861.         END;
  862.     END;
  863.  
  864. {Create INIT.SRC}
  865.     RM('MEERROR^MessageBox /B=0/NW=1/T=SAVING CONFIGURATION/M=Building "' + user_id + 'INIT.SRC"...');
  866.     Jx := Switch_Win_Id(Macro_Window);
  867.     Erase_Window;
  868.     Undo_Stat := false;
  869.     Return_Str := User_Id + 'INIT.SRC';
  870.     RM('MakeUserPath');
  871.     File_Name := Return_Str;
  872.     Set_Global_Int('Init_Window',Window_Id);
  873. {Create the start of a macro source code}
  874.     PUT_LINE('$MACRO ' + USER_ID + 'INIT DUMP;');
  875.     Insert_Mode := True;
  876.     Down;
  877.     Put_Line('{This macro was created by the Multi-Edit install macro version ' + Version + '}');
  878.     Down;
  879.     Down;
  880.     Eol;
  881.     Cr;
  882.     Cr;
  883.     Up;
  884.     Up;
  885.  
  886. {the Expanded memory settings need to come first}
  887.     IF global_int('@EMS_AMOUNT@') <> 0 THEN
  888.         Put_Line('Init_Ems_Support(' + Str(Global_Int('@EMS_AMOUNT@')) + ');');
  889.         Down;
  890.         Put_Line('Set_Global_Int(''@EMS_AMOUNT@'',' + Str(Global_Int('@EMS_AMOUNT@')) + ');');
  891.         Down;
  892.     END;
  893.     Put_Line('EMS_Stat := ' + Str(Global_Int('EMS_DEFAULT')) + ';');
  894.     Down;
  895.     Put_Line('Set_Global_Int(''EMS_DEFAULT'',' + Str(Global_Int('EMS_DEFAULT')) + ');');
  896.     Down;
  897.     Put_Line('Swap_Mode := ' + Str( swap_mode ) + ';');
  898.     Down;
  899.     Put_Line('Max_Swap_EMS := ' + Str( Max_Swap_Ems ) + ';');
  900.     Down;
  901.     Put_Line('Swap_Mem := ' + Str( Swap_Mem ) + ';');
  902.     Down;
  903.  
  904.     {Make_Message('Building "' + user_id + 'INIT.SRC"...');}
  905.     Working;
  906.  
  907.  
  908. {Create all the other settings, most are self explanitory}
  909.     Down;
  910.     Down;
  911.     Put_Line('ERROR_LEVEL := 0;'); Down;
  912.     Put_Line('Set_Global_Str(''@KEYMAP_NAME@'',''' + Global_Str('@KEYMAP_NAME@') + ''');');
  913.     Down;
  914.     Put_Line('RM(''' + User_Id + 'KEYMAP'');'); Down;
  915.     Put_Line('IF ERROR_LEVEL <> 0 THEN'); Down;
  916.     Put_Line('  RM(''KEYMAP'');'); Down;
  917.     Put_Line('END;'); down;
  918.     Down;
  919.     Put_Line('{Default settings}');
  920.     Down;
  921.     Put_Line('Set_Global_Int(''Default_Insert_Mode'',' + Str(Global_Int('Default_Insert_Mode')) + ');');
  922.     Down;
  923.     Put_Line('Set_Global_Str(''SWITCHES'',''' + Global_Str('DEF_SWITCHES') + ''');');
  924.     Down;
  925.     Put_Line('Set_Global_Str(''DEF_SWITCHES'',''' + Global_Str('DEF_SWITCHES') + ''');');
  926.     Down;
  927.     Put_Line('Set_Global_Str(''REPL_SWITCHES'',''' + Global_Str('DEF_REPL_SWITCHES') + ''');');
  928.     Down;
  929.     Put_Line('Set_Global_Str(''DEF_REPL_SWITCHES'',''' + Global_Str('DEF_REPL_SWITCHES') + ''');');
  930.     Down;
  931.     Put_Line('Set_Global_Str(''FSWITCHES'',''' + Global_Str('DEF_FS_SWITCHES') + ''');');
  932.     Down;
  933.     Put_Line('Set_Global_Str(''DEF_FS_SWITCHES'',''' + Global_Str('DEF_FS_SWITCHES') + ''');');
  934.     Down;
  935.     Put_Line('Set_Global_Str(''FSEARCH_PATH'',''' + Global_Str('DEF_FS_PATH') + ''');');
  936.     Down;
  937.     Put_Line('Set_Global_Str(''DEF_FS_PATH'',''' + Global_Str('DEF_FS_PATH') + ''');');
  938.     Down;
  939.     Put_Line('Insert_Mode := Global_Int(''Default_Insert_Mode'');');
  940.     Down;
  941.     Put_Line('Explosions := ' + Str(Explosions) + ';');
  942.     Down;
  943.     Put_Line('Backups := ' + Str(Backups) + ';');
  944.     Down;
  945.     Put_Line('Backup_Path := ''' + Backup_Path + ''';');
  946.     Down;
  947.     Put_Line('Temp_Path := ''' + Temp_Path + ''';');
  948.     Down;
  949. {see the macro STRSRC in this same macro file for an explanation}
  950.     RM('USERIN^STRSRC ' + Page_Str );
  951.     Put_Line('Page_Str := ''' + Return_Str + ''';');
  952.     Down;
  953.     Put_Line('Truncate_Spaces := ' + Str(Truncate_Spaces) + ';');
  954.     Down;
  955.     Put_Line('Set_Global_Str(''@AUTOSAVEPARMS'',''' + Global_Str('@AUTOSAVEPARMS') + ''');');
  956.     Down;
  957.  {Put_Line('AutoSave := ' + Str(AutoSave) + ';');
  958.     Down;}
  959.     Put_Line('Ctrl_Help := ' + Str(Ctrl_Help) + ';');
  960.     Down;
  961.     Put_Line('Ctrl_Z := ' + Str(Ctrl_Z) + ';');
  962.     Down;
  963.     Put_Line('Eof_Cr := ' + Str(Eof_Cr) + ';');
  964.     Down;
  965.     Put_Line('File_Locking := ' + Str(File_Locking) + ';');
  966.     Down;
  967.     Put_Line('Display_Tabs := ' + Str(Display_Tabs) + ';');
  968.     Down;
  969.     Put_Line('Tab_Expand := ' + Str(T_Tab_Expand) + ';');
  970.     Down;
  971.     Put_Line('Mouse_H_Sense := ' + Str(Mouse_H_Sense) + ';');
  972.     Down;
  973.     Put_Line('Mouse_V_Sense := ' + Str(Mouse_V_Sense) + ';');
  974.     Down;
  975.     Put_Line('Mouse := ' + Str(Mouse) + ';');
  976.     Down;
  977.     Put_Line('Mou_Disappear := ' + Str(Mou_Disappear) + ';');
  978.     Down;
  979.     Put_Line('Set_Global_Str(''@MOUSEPARMS'',''' + global_str('@MOUSEPARMS') + ''');');
  980.     down;
  981.     RM('USERIN^STRSRC ' + Word_Delimits );
  982.     Put_Line('Word_Delimits := ''' + Return_Str + ''';');
  983.     Down;
  984.     Put_Line('Ins_Cursor := ' + Str(Ins_Cursor) + ';');
  985.     Down;
  986.     Put_Line('Ovr_Cursor := ' + Str(Ovr_Cursor) + ';');
  987.     Down;
  988.     Put_Line('Max_Undo := ' + Str(Max_Undo) + ';');
  989.     Down;
  990.     Put_Line('Column_Move_Style := ' + Str(Column_Move_Style) + ';');
  991.     Down;
  992.     Put_Line('Set_Global_Str(''FORMAT_CODE_DELIMIT'',''' + Global_Str('FORMAT_CODE_DELIMIT') + ''');');
  993.     Down;
  994.     Put_Line('Set_Global_Str(''PRINTER_DEVICE'',''' + Global_Str('PRINTER_DEVICE') + ''');');
  995.     Down;
  996. {This is a temporary work-around until the macro compiler can handle lines
  997. longer than 255}
  998.     Put_Line('Set_Global_Str(''PRINTER_TYPE'',');
  999.     Down;
  1000.     Jx := (Length(Global_Str('PRINTER_TYPE')) / 200) +
  1001.         ((Length(Global_Str('PRINTER_TYPE')) MOD 200) > 0) - 1;
  1002.     Jy := 0;
  1003.     WHILE (Jx) DO
  1004.         RM('USERIN^STRSRC ' + Copy(Global_Str('PRINTER_TYPE'),Jy + 1,200));
  1005.         Put_Line('''' + Return_Str + ''' +' );
  1006.         Down;
  1007.         Jy := Jy + 200;
  1008.         --Jx
  1009.     END;
  1010.     RM('USERIN^STRSRC ' + Copy(Global_Str('PRINTER_TYPE'),Jy + 1,200));
  1011.     Put_Line('''' + Return_Str + ''');');
  1012.     Down;
  1013. {
  1014.     Put_Line('Set_Global_Str(''PRINTER_TYPE'', ''' + Global_Str('PRINTER_TYPE') + ''');');
  1015.     Down;
  1016. }
  1017.     Put_Line('Set_Global_Int(''RESTORE'',' + Str(Global_Int('RESTORE')) + ');');
  1018.     Down;
  1019.  {The following 16 lines are for the screen configuration for status lines
  1020.  function key lines, file name lines, etc.}
  1021.     Put_Line('Set_Global_Str(''@SCREEN_SETA'',''' + Global_STR('@SCREEN_SETA') + ''');');
  1022.     Down;
  1023.     Put_Line('Set_Global_Str(''@SCREEN_SETB'',''' + Global_STR('@SCREEN_SETB') + ''');');
  1024.     Down;
  1025.     Put_Line('Set_Global_Int(''DEF_SCRN_STYLE'',' + Str(Global_Int('DEF_SCRN_STYLE')) + ');');
  1026.     Down;
  1027.     Put_Line('Set_Global_Int(''CUR_SCRN'',' + Str(Global_Int('DEF_SCRN_STYLE')) + ');');
  1028.     Down;
  1029.  
  1030.     Put_Line('Init_Video_Mode := ' + Str(Video_Mode) + ';');
  1031.     Down;
  1032.  
  1033.     Put_Line('Error_Color := ' + Str(Error_Color) + ';');
  1034.     Down;
  1035.     Put_Line('Shadow_Color := ' + Str(Shadow_Color) + ';');
  1036.     Down;
  1037.     Put_Line('Shadow_Char := ''||' + str(ascii(Shadow_Char)) + ''';');
  1038.     Down;
  1039.     Put_Line('W_T_Color := ' + Str(w_t_color) + ';');
  1040.     Down;
  1041.     Put_Line('W_H_Color := ' + Str(w_h_color) + ';');
  1042.     Down;
  1043.     Put_Line('W_B_Color := ' + Str(w_b_color) + ';');
  1044.     Down;
  1045.     Put_Line('W_C_Color := ' + Str(w_c_color) + ';');
  1046.     Down;
  1047.     Put_Line('W_EOF_Color := ' + Str(w_EOF_color) + ';');
  1048.     Down;
  1049.     Put_Line('W_S_Color := ' + Str(w_s_color) + ';');
  1050.     Down;
  1051.     Put_Line('M_T_Color := ' + Str(m_t_color) + ';');
  1052.     Down;
  1053.     Put_Line('M_S_Color := ' + Str(m_s_color) + ';');
  1054.     Down;
  1055.     Put_Line('M_B_Color := ' + Str(m_b_color) + ';');
  1056.     Down;
  1057.     Put_Line('M_H_Color := ' + Str(m_h_color) + ';');
  1058.     Down;
  1059.     Put_Line('D_T_Color := ' + Str(d_t_color) + ';');
  1060.     Down;
  1061.     Put_Line('D_S_Color := ' + Str(d_s_color) + ';');
  1062.     Down;
  1063.     Put_Line('D_B_Color := ' + Str(d_b_color) + ';');
  1064.     Down;
  1065.     Put_Line('D_H_Color := ' + Str(d_h_color) + ';');
  1066.     Down;
  1067.     Put_Line('H_T_Color := ' + Str(h_t_color) + ';');
  1068.     Down;
  1069.     Put_Line('H_T1_Color := ' + Str(h_t1_color) + ';');
  1070.     Down;
  1071.     Put_Line('H_T2_Color := ' + Str(h_t2_color) + ';');
  1072.     Down;
  1073.     Put_Line('H_T3_Color := ' + Str(h_t3_color) + ';');
  1074.     Down;
  1075.     Put_Line('H_S_Color := ' + Str(h_s_color) + ';');
  1076.     Down;
  1077.     Put_Line('H_B_Color := ' + Str(h_b_color) + ';');
  1078.     Down;
  1079.     Put_Line('H_H_Color := ' + Str(h_h_color) + ';');
  1080.     Down;
  1081.     Put_Line('H_R_Color := ' + Str(h_r_color) + ';');
  1082.     Down;
  1083.     Put_Line('H_F_Color := ' + Str(h_f_color) + ';');
  1084.     Down;
  1085.     Put_Line('FKey_Color := ' + Str(fkey_color) + ';');
  1086.     Down;
  1087.     Put_Line('FNum_Color := ' + Str(fnum_color) + ';');
  1088.     Down;
  1089.     Put_Line('Stat1_Color := ' + Str(stat1_color) + ';');
  1090.     Down;
  1091.     Put_Line('Stat2_Color := ' + Str(stat2_color) + ';');
  1092.     Down;
  1093.     Put_Line('Message_Color := ' + Str(message_color) + ';');
  1094.     Down;
  1095.     Put_Line('Working_Color := ' + Str(working_color) + ';');
  1096.     Down;
  1097.   Put_Line('Background_Color := ' + Str(background_color) + ';');
  1098.     Down;
  1099.  
  1100.     Put_Line('Logo_Screen := ' + Str(Logo_Screen)+ ';');
  1101.     Down;
  1102. {Dos shell stuff}
  1103.     Put_Line('Set_Global_Str(''DIR_SORT_STR'',''' + Global_Str('DIR_SORT_STR') + ''');');
  1104.     Down;
  1105.     Put_Line('Set_Global_Int(''@DIR_MODE@'',' + Str(Global_Int('@DIR_MODE@')) + ');');
  1106.     Down;
  1107. {Condensed mode globals}
  1108. {
  1109.     Put_Line('Set_Global_Int(''CONDENSE_MODE'',' + Str(Global_Int('CONDENSE_MODE')) + ');');
  1110.     Down;
  1111.     Put_Line('Set_Global_Int(''CUTOFF_COL'',' + Str(Global_Int('CUTOFF_COL')) + ');');
  1112.     Down;
  1113.     RM('USERIN^STRSRC ' + Global_Str('CONDENSE_SEARCH'));
  1114.     Put_Line('Set_Global_Str(''CONDENSE_SEARCH'',''' + Return_Str + ''');');
  1115.     Down;
  1116.     Put_Line('Set_Global_Str(''CONDENSE_SWITCHES'',''' + Global_Str('CONDENSE_SWITCHES') + ''');');
  1117.     Down;
  1118. }
  1119. {Calculator Parameters}
  1120.     Temp_Stuff := '/X=' + Parse_Str('/X=',Global_Str('Calc_Params')) +
  1121.         '/Y=' + Parse_Str('/Y=',Global_Str('Calc_Params')) +
  1122.         '/BASE=' + Parse_Str('/BASE=',Global_Str('Calc_Params'));
  1123.     Put_Line('Set_Global_Str(''CALC_PARAMS'',''' + Temp_Stuff + ''');');
  1124.     Down;
  1125.  
  1126. {The following are in conjuction with the keyboard key repeat(typematic) speed
  1127. setup macro which uses the new interrupt procedure}
  1128.     Put_Line('Set_Global_Int(''KEYSPEED'',' + Str(Global_Int('KEYSPEED')) + ');');
  1129.     Down;
  1130.     Put_Line('Set_Global_Int(''KEYDELAY'',' + Str(Global_Int('KEYDELAY')) + ');');
  1131.     Down;
  1132.     Put_Line('Set_Global_Int(''NO_KEYSPEED'',' + str( global_int('NO_KEYSPEED') ) + ');');
  1133. {Put ending line}
  1134.     Down;
  1135.     PUT_LINE('END_MACRO;');
  1136.     Tab_Expand := True;
  1137.     Save_File;
  1138.  
  1139.     Call COMPILE;
  1140.  
  1141.     IF (Return_Int = 0) THEN
  1142.         copy_file( me_path + user_id + 'KEYMAP.MAC',
  1143.                                     me_path + user_id + 'INIT.MAC',
  1144.                                     TRUE );
  1145.  
  1146.      {Make_Message( 'Multi-Edit configuration saved.');}
  1147.         Set_Global_Int('SETUP_CHANGED',0);
  1148.  
  1149. {This is to clear out all existing function key labels in edit mode.}
  1150.         Jx := 4;
  1151.         WHILE (Jx) DO
  1152.             --Jx;
  1153.             Jy := 10;
  1154.             WHILE (Jy) DO
  1155.                 Flabel('',(Jx * 10) + Jy,0);
  1156.                 --Jy;
  1157.             END;
  1158.         END;
  1159.  
  1160.         RM( user_id + 'INIT' );
  1161.         Del_File(me_path + user_id + 'SETER.TMP');
  1162.         Error_Level := 0;
  1163.     ELSE
  1164.      {Make_Message( 'Error occurred!! Configuration NOT saved.'); }
  1165.         Return_Str := 'COMP ERROR';
  1166.     END;
  1167.  
  1168.     Goto END_OF_MAC;
  1169. {********************************** SUBROUTINES ******************************}
  1170.     BUILD_KEY_LINE:
  1171.         Jx := Parse_Int('MODE=',Tstr);
  1172.         IF ((Jx < 1) or (Jx > 4)) THEN
  1173.             Jx := 1;
  1174.         END;
  1175.         Mode_Str := Remove_Space(Copy('EDIT     DOS_SHELLTERM     ALL',
  1176.             ((Jx - 1) * 9) + 1, 9));
  1177.         Cmd := (Parse_Str('MF=',TStr) = 'NOT APPLICABLE');
  1178.         IF (Cmd) THEN
  1179.             MStr := 'CMD_TO_KEY(';
  1180.         ELSE
  1181.             MStr := 'MACRO_TO_KEY(';
  1182.         END;
  1183.         MStr := MStr + KName + ',';
  1184.         IF (Cmd = False) THEN
  1185.             MStr := MStr + '''' + Parse_Str('MF=',Tstr) + '^';
  1186.         END;
  1187.         MStr := MStr + MName;
  1188.         IF (Cmd = False) THEN
  1189.             MStr := MStr + ' ' + Parse_Str('PARAM=',TSTr) + '''';
  1190.         END;
  1191.         Jx := Parse_Int('',Tstr);
  1192.         IF ((Jx < 1) or (Jx > 4)) THEN
  1193.             Jx := 1;
  1194.         END;
  1195.         MStr := MStr + ',' + Mode_Str + ');';
  1196.         Put_Line(MStr);
  1197.         Down;
  1198.         IF (Parse_Str('FKL=',TStr) <> '') THEN
  1199.     {See if this key is a function key}
  1200.  
  1201.             MStr := Parse_Str('F',KName);;
  1202.             IF (MStr <> '') THEN
  1203.                 WHILE (XPos(Copy(Mstr,Svl(MStr),1),'0123456789',1) = 0) DO
  1204.                     MStr := Copy(MStr,1,Svl(MStr) - 1);
  1205.                     IF (Mstr = '') THEN
  1206.                         Goto NO_LABEL;
  1207.                     END;
  1208.                 END;
  1209.                 IF (MStr <> '') THEN
  1210.                     IF (Val(jx,Mstr) = 0) THEN
  1211.                         IF (Jx < 11) THEN
  1212.                             IF (XPos('SHFT',Caps(KName),1)) THEN
  1213.                                 Jx := Jx + 10;
  1214.                             END;
  1215.                             IF (XPos('CTRL',Caps(KName),1)) THEN
  1216.                                 Jx := Jx + 20;
  1217.                             END;
  1218.                             IF (XPos('ALT',Caps(KName),1)) THEN
  1219.                                 Jx := Jx + 30;
  1220.                             END;
  1221.                             Put_Line('FLABEL(''' + Parse_Str('FKL=',TStr) + ''',' + Str(Jx) +
  1222.                                 ',' + Mode_Str + ');');
  1223.                             Down;
  1224.                         END;
  1225.                     END;
  1226.                 END;
  1227.             END;
  1228.         END;
  1229.     NO_LABEL:
  1230.     RET;
  1231.  
  1232. COMPILE:
  1233.     Reg_Exp_Stat := True;
  1234.     Return_Int := 0;
  1235.     TStr := Truncate_Path(File_Name);
  1236.     Kill_Box;
  1237.     RM('MEERROR^MessageBox /B=0/NW=1/T=SAVING CONFIGURATION/M=Compiling "'+ TStr +'"...');
  1238.  {Make_Message('Compiling "'+ TStr +'"...');}
  1239. {build a command line to compile the macro}
  1240.     Whole_Line := 'MEMAC.EXE -P' + Me_Path + ' ' + File_Name + '>' + me_path + user_id + 'SETER.TMP';
  1241. {If the Dos version is 3.0 or above, then add the ME_Path to the compiler
  1242. command line to insure the correct version of the macro compiler gets run.}
  1243.     IF ((Dos_Version and $00FF) > 2) THEN
  1244.         Whole_Line := ME_PATH + Whole_Line;
  1245.     END;
  1246.  
  1247.     Del_File(me_path + user_id + 'SETER.TMP');
  1248.     Error_Level := 0;
  1249.     Return_str := whole_line;
  1250.     RM('MEUTIL1^EXEC /SWAP=0/MEM=9600/CMD=1');
  1251.     kill_box;
  1252.     IF (Error_Level <> 0) THEN
  1253.             RM('MEERROR^Beeps /C=1');
  1254. {Error messages for unsuccessful compile}
  1255.         IF (Error_Level = 3008) THEN
  1256.     NO_MEMORY_ERROR:
  1257.             rm('MEERROR^MessageBox /T=INSUFFICIENT MEMORY TO COMPILE ' + TStr +
  1258.                     '!/B=2/M=Please exit editor and compile ' + TStr + ' in the Multi-Edit directory.');
  1259.             Error_Level := 0;
  1260.             Return_Int := 1;
  1261.             RET;
  1262.         END;
  1263.         RM( 'MEERROR' );
  1264.         Return_Int := 1;
  1265.         RET;
  1266.     END;
  1267.     Switch_Window(Window_Count);
  1268.     Create_Window;
  1269.     Error_Window := Window_Id;
  1270.     Load_File(me_path + user_id + 'SETER.TMP');
  1271.     IF (Error_Level = 3002) THEN
  1272.             RM('MEERROR^Beeps /C=1');
  1273. PATH_ERROR:
  1274.             RM('MEERROR^MessageBox /T=ERROR IN COMPILING ' + TStr +
  1275.                 '!/B=2/M=Check for proper path to macro compiler.');
  1276.             Error_Level := 0;
  1277.             Return_Int := 1;
  1278.             RET;
  1279.     END;
  1280.     Ignore_case := True;
  1281.     If (Search_Fwd('{MEMORY}||{RUNTIME}||{RAGTIME}',0)) THEN
  1282.         Goto No_Memory_Error;
  1283.     END;
  1284.     Tof;
  1285.     If (Search_Fwd('{Error}||{Aborted}',0)) Then
  1286.         RM('MEERROR^Beeps /C=1');
  1287.             RM('MEERROR^MessageBox /T=ERROR IN COMPILING ' + TStr +
  1288.                     '!/B=2/M=' + Copy(Get_Line,1,76));
  1289.         Write('Press any key...',34,13,0,Error_Color);
  1290.         Refresh := True;
  1291.         {Make_Message('');}
  1292.         Kill_Box;
  1293.         Kill_box;
  1294.         New_Screen;
  1295.         Messages := True;
  1296.         Undo_Stat := True;
  1297.         Return_Int := 1;
  1298.         RET;
  1299.     End;
  1300.     TOF;
  1301.     If (Search_Fwd(shorten_str(Version),1) = 0) Then
  1302. {we should only get here if somehow a different version of the macro compiler
  1303. was run than the version of ME.  A distinct possiblilty if multiple versions
  1304. of ME are on the system.}
  1305.         RM('MEERROR^MESSAGEBOX /B=2/T=WARNING:  MACRO COMPILER REPORTS WRONG VERSION' +
  1306.                     '/M=Unpredictable results could occur.  Check DOS environment for possible incorrect search path.');
  1307.         {Make_Message('');}
  1308.         Kill_Box;
  1309.         Kill_box;
  1310.         New_Screen;
  1311.         Messages := True;
  1312.         Undo_Stat := True;
  1313.         Return_Str := 'COMP WARNING';
  1314.     End;
  1315.     IF (Switch_Win_Id(Error_Window)) THEN
  1316.         Delete_Window;
  1317.     END;
  1318.     IF return_str <> 'COMP WARNING' THEN
  1319.         Del_File(me_path + user_id + 'SETER.TMP');
  1320.     END;
  1321.     Jx := Switch_Win_Id(Macro_Window);
  1322. RET;
  1323. {*****************************************************************************}
  1324.  
  1325. END_OF_MAC:
  1326.     while box_count > bc do
  1327.         kill_box;
  1328.     END;
  1329.  
  1330.     IF (Switch_Win_Id(Macro_Window)) THEN
  1331.         Delete_Window;
  1332.     END;
  1333. {clean up altered system variables}
  1334.     Reg_Exp_Stat := T_Reg_Exp_Stat;
  1335.     Undo_Stat := True;
  1336.     Tab_Expand := T_Tab_Expand;
  1337.     Insert_Mode := T_Insert_Mode;
  1338. END_MACRO;
  1339.  
  1340. $MACRO SETKEYS TRANS;
  1341. {******************************************************************************
  1342.                                                              MULTI-EDIT MACRO
  1343.  
  1344. Name:  SETKEYS
  1345.  
  1346. Description:  This is the key remapping menu.
  1347.  
  1348. Parameters:
  1349.                             /X=        X coordinate for menu box
  1350.                             /Y=        Y coordinate for menu box
  1351.  
  1352.                              (C) Copyright 1989 by American Cybernetics, Inc.
  1353. ******************************************************************************}
  1354.  
  1355.     IF (Global_Str('@KEYMAP_NAME@') = '') THEN
  1356.         Set_Global_Str('@KEYMAP_NAME@','KN=MULTI-EDITFN=KEYMAP');
  1357.     END;
  1358.     RM('USERIN^XMENU /T=1/L=CURRENT MAP IS "' + parse_str('KN=', Global_Str('@KEYMAP_NAME@'))
  1359.                         + '"/X=' + Str(Parse_Int('/X=',MParm_Str)) + '/Y=' +
  1360.         Str(Parse_Int('/Y=',MParm_Str) - 10) +
  1361.         '/B=1/S=1/M=Edit current keymap(INKE)Select new keymap()');
  1362.     IF (Return_Int = 2) THEN
  1363.         Def_Str(T_KEY[36]);
  1364.         T_Key := Global_Str('@KEYMAP_NAME@');
  1365.         RM('USERIN^DB /F=MECONFIG.DB/DPT=KMAPLST.DB/NC=1/NOALPHA=1/LO=1/PRE=KLIST/DT=─/LT=SELECT A KEYMAP/GLO=@KEYMAP_NAME@/H=INKE/MACRO=KEYLIST_CHECK');
  1366.  
  1367.         IF ((Return_Int = 1) and (T_Key <> Global_Str('@KEYMAP_NAME@'))) THEN
  1368.             Return_Str := Parse_Str('FN=',Global_str('@KEYMAP_NAME@')) + '.DB';
  1369.             RM('MakeUserPath');
  1370.             IF ((File_Exists(Return_Str) = False) and
  1371.                     (File_Exists(Me_Path + Parse_Str('FN=',Global_str('@KEYMAP_NAME@')) +
  1372.                     '.DB') = False)) THEN
  1373.                 RM('MEERROR^MessageBox /T=WARNING/B=2/M=The keymap data file: ' +
  1374.                         Return_Str + ' does not exist.  If you save the settings, all key assignments will be disabled.');
  1375.             END;
  1376.             Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $02);
  1377.         ELSE
  1378.             Set_Global_Str('@KEYMAP_NAME@',T_Key);
  1379.         END;
  1380.         IF (Global_Str('@KEYMAP_NAME@') = '') THEN
  1381.             Set_Global_Str('@KEYMAP_NAME@','KN=MULTI-EDITFN=KEYMAP');
  1382.         END;
  1383.  
  1384.     ELSIF (Return_Int = 1) THEN
  1385.         Set_Global_Str('KEYDS','MC=17DESCR=26K1=16K2=16');
  1386.         RM('USERIN^DB /NDF=1/NSF=1/F=' + Parse_Str('FN=',Global_Str('@KEYMAP_NAME@')) +
  1387.     '.DB/NOALPHA=1/PRE=KEY/GLO=@KEYREC#/LT=EDITING THE ' +
  1388.     Parse_Str('KN=',Global_Str('@KEYMAP_NAME@')) +
  1389.     ' KEYMAP.  SELECT A MACRO////COMMAND/DT=KEYSTROKE ASSIGNMENT/H=INKE/DS=KEYDS/MACRO=KEY_CHECK');
  1390.         IF Global_Int('@DB_FILE_CHANGED') THEN
  1391.             Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $02);
  1392.         END;
  1393.     END;
  1394. EXIT:
  1395.     return_int := 0;
  1396. END_MACRO;
  1397.  
  1398. $MACRO KEYLIST_CHECK TRANS;
  1399. {******************************************************************************
  1400.                                                              MULTI-EDIT MACRO
  1401.  
  1402. Name:  KEYLIST_CHECK
  1403.  
  1404. Description:
  1405.  
  1406.                              (C) Copyright 1989 by American Cybernetics, Inc.
  1407. ******************************************************************************}
  1408.     Def_Int(Choice);
  1409.     Def_str(t_str[80]);
  1410.  
  1411.     Set_Global_str('@KEYMAP_NAME@',Caps(Global_str('@KEYMAP_NAME@')));
  1412.     IF (Parse_Int('/P=',MParm_Str)) THEN
  1413. CHECK_AGAIN:
  1414.         Return_Str := Parse_Str('FN=',Global_str('@KEYMAP_NAME@')) + '.DB';
  1415.         RM('MakeUserPath');
  1416.         t_str := Return_str;
  1417.         IF (File_Exists(return_str) = 0) THEN
  1418.             RM('USERIN^XMENU /B=1/X=10/Y=10/L=' + Return_Str +
  1419.             ' DOESN''T EXIST/M=Ignore(INKEY)Copy-another-keymap-file()change-File-name()');
  1420.             Choice := Return_Int;
  1421.             IF (Choice = 2) THEN
  1422.                 Mark_Pos;
  1423.                 Del_Line;
  1424.                 RM('USERIN^DB /F=MECONFIG.DB/X=5/Y=3/DPT=KMAPLST.DB/NC=1/NE=1/ND=1/NI=1/NOALPHA=1/LO=1/PRE=KLIST2/DT=─/LT=SELECT KEYMAP TO COPY/GLO=@KEYMAP_CHECK@/H=INKE');
  1425.                 IF (Return_Int = 1) THEN
  1426.                     Copy_File(Get_Path(t_Str) + Parse_Str('FN=',Global_str('@KEYMAP_CHECK@')) + '.DB ',T_Str, false);
  1427.                 END;
  1428.                 Goto_Mark;
  1429.                 Up;
  1430.                 Eol;
  1431.                 Insert_Mode := True;
  1432.                 Cr;
  1433.                 Goto CHECK_AGAIN;
  1434.             ELSIF (Choice = 3) THEN
  1435.                 Return_Str := '';
  1436.                 RM( 'USERIN^QUERYBOX /T=/P=Enter new filename(no extension)/W=8/L=10/C=10');
  1437.                 Set_Global_str('@KEYMAP_NAME@',
  1438.                     'KN=' + Parse_Str('KN=',Global_str('@KEYMAP_NAME@')) +
  1439.                     'FN=' + Return_Str);
  1440.                 Goto CHECK_AGAIN;
  1441.             END;
  1442.         END;
  1443.     END;
  1444. END_MACRO;
  1445.  
  1446. $MACRO KEY_CHECK TRANS;
  1447. {******************************************************************************
  1448.                                                              MULTI-EDIT MACRO
  1449.  
  1450. Name:  KEY_CHECK
  1451.  
  1452. Description:  Checks for key assigment conflicts with currently edited key
  1453. record and alerts user.
  1454.  
  1455.                              (C) Copyright 1989 by American Cybernetics, Inc.
  1456. ******************************************************************************}
  1457.     Def_Str(S_Str,G_Str);
  1458.     Def_Int(T_Ignore_Case,T_Reg_Exp_Stat,K_Line,Check_Mode,T_Mode,Conflict);
  1459.  
  1460.     G_Str := Global_Str(Parse_Str('/GLO=',MParm_Str));
  1461.     Check_Mode := Parse_Int('MODE=',G_Str);
  1462.     IF (Check_Mode < 1) THEN
  1463.         Check_Mode := 1;
  1464.     END;
  1465.     IF (Parse_Int('/P=',MParm_Str)) THEN
  1466.         T_Reg_Exp_Stat := Reg_Exp_Stat;
  1467.         T_Ignore_Case := Ignore_Case;
  1468.         Reg_Exp_Stat := True;
  1469.         Ignore_Case := True;
  1470.  
  1471.         Mark_Pos;
  1472.         K_Line := C_Line;
  1473.         S_Str := Parse_Str('K1=',G_Str);
  1474.         IF (S_Str <> '') THEN
  1475.             Call CHECK_FOR_CONFLICT;
  1476.             IF (Conflict) THEN
  1477.                 Goto DONE_CHECKING;
  1478.             END;
  1479.         END;
  1480.         S_Str := Parse_Str('K2=',G_Str);
  1481.         IF (S_Str <> '') THEN
  1482.             Call CHECK_FOR_CONFLICT;
  1483.         END;
  1484. {
  1485. MC=MAINHELPDESCR=Main help screenK1=<F1>K2=<AltH>FKL=HelpMODE=1MF=USERIN
  1486. }
  1487. DONE_CHECKING:
  1488.         Goto_Mark;
  1489.         Reg_Exp_Stat := T_Reg_Exp_Stat;
  1490.         Ignore_Case := T_Ignore_Case;
  1491.  
  1492. {Begin "on the fly" key changes support}
  1493. {Assign the current keys in this record}
  1494.         --Check_Mode;
  1495. {Assign primary key if present}
  1496.         Return_Str := Parse_Str('K1=',G_Str);
  1497.         IF (Return_Str <> '') THEN
  1498.             RM('MAKE_SCAN_CODES');
  1499.             IF (Return_Int > 0) THEN
  1500.                 S_Str := Parse_Str('MF=',G_Str);
  1501.                 IF (S_Str = 'NOT APPLICABLE') THEN
  1502.                     RM('ASSIGN_CMD /C=' + Parse_Str('MC=',G_Str) +
  1503.                                          '/K=' + Str(Return_Int) +
  1504.                                          '/M=' + Str(Check_Mode));
  1505.                 ELSE
  1506.                     Macro_To_Key(Return_Int,S_Str + '^' + Parse_Str('MC=',G_Str) +
  1507.                         ' ' + Parse_Str('PARAM=',G_Str),Check_Mode);
  1508.                 END;
  1509. {If this one is a function key, assign the label also}
  1510.                 IF (Global_Int('!FKEY@')) THEN
  1511.                     FLabel(Parse_Str('FKL=',G_Str),Global_Int('!FKEY@'),Check_Mode);
  1512.                 END;
  1513.             END;
  1514.         END;
  1515. {Assign secondary key if present}
  1516.         Return_Str := Parse_Str('K2=',G_Str);
  1517.         IF (Return_Str <> '') THEN
  1518.             RM('MAKE_SCAN_CODES');
  1519.             IF (Return_Int > 0) THEN
  1520.                 S_Str := Parse_Str('MF=',G_Str);
  1521.                 IF (S_Str = 'NOT APPLICABLE') THEN
  1522.                     RM('ASSIGN_CMD /C=' + Parse_Str('MC=',G_Str) +
  1523.                                          '/K=' + Str(Return_Int) +
  1524.                                          '/M=' + Str(Check_Mode));
  1525.                 ELSE
  1526.                     Macro_To_Key(Return_Int,S_Str + '^' + Parse_Str('MC=',G_Str) +
  1527.                         ' ' + Parse_Str('PARAM=',G_Str),Check_Mode);
  1528.                 END;
  1529. {If this one is a function key, assign the label also}
  1530.                 IF (Global_Int('!FKEY@')) THEN
  1531.                     FLabel(Parse_Str('FKL=',G_Str),Global_Int('!FKEY@'),Check_Mode);
  1532.                 END;
  1533.             END;
  1534.         END;
  1535. {Assign menu global if present}
  1536.         S_Str := Parse_Str('MID=',G_Str);
  1537.         IF (S_Str <> '') THEN
  1538.             Set_Global_Str(S_Str,Parse_Str('K1=',G_Str));
  1539.         END;
  1540.     ELSE
  1541. {Unnassign the current keys in this record}
  1542.         --Check_Mode;
  1543. {Unnasign primary key if present}
  1544.         Return_Str := Parse_Str('K1=',G_Str);
  1545.         IF (Return_Str <> '') THEN
  1546.             RM('MAKE_SCAN_CODES');
  1547.             IF (Return_Int > 0) THEN
  1548.                 Unassign_Key(Return_Int,Check_Mode);
  1549. {If this one is a function key, kill the label also}
  1550.                 IF (Global_Int('!FKEY@')) THEN
  1551.                     FLabel('',Global_Int('!FKEY@'),Check_Mode);
  1552.                 END;
  1553.             END;
  1554.         END;
  1555. {Unnasign secondary key if present}
  1556.         Return_Str := Parse_Str('K2=',G_Str);
  1557.         IF (Return_Str <> '') THEN
  1558.             RM('MAKE_SCAN_CODES');
  1559.             IF (Return_Int > 0) THEN
  1560.                 Unassign_Key(Return_Int,Check_Mode);
  1561. {If this one is a function key, kill the label also}
  1562.                 IF (Global_Int('!FKEY@')) THEN
  1563.                     FLabel('',Global_Int('!FKEY@'),Check_Mode);
  1564.                 END;
  1565.             END;
  1566.         END;
  1567. {Unnasign menu global if present}
  1568.         S_Str := Parse_Str('MID=',G_Str);
  1569.         IF (S_Str <> '') THEN
  1570.             Set_Global_Str(S_Str,'');
  1571.         END;
  1572. {End "on the fly" key changes support}
  1573.  
  1574.     END;
  1575.     Goto EXIT;
  1576.  
  1577.  
  1578. CHECK_FOR_CONFLICT:
  1579.         Conflict := False;
  1580.         S_Str := 'K?=' + S_Str;
  1581.         Tof;
  1582. KEEP_LOOKING:
  1583.         IF (Search_Fwd(S_Str,0)) THEN
  1584.             T_Mode := Parse_Int('MODE=',Get_Line);
  1585.             IF (T_Mode < 1) THEN
  1586.                 T_Mode := 1;
  1587.             END;
  1588.             IF ((C_Line = K_Line) or (T_Mode <> Check_Mode)) THEN
  1589.                 Eol;
  1590.                 Goto KEEP_LOOKING;
  1591.             END;
  1592.             Conflict := True;
  1593.             RM('MEERROR^MessageBox /T=WARNING/B=1/M=The key:' + Copy(S_Str,5,20) +
  1594.                     ' is already assigned to:' + Parse_Str('MC=',Get_Line));
  1595.         END;
  1596.     RET;
  1597.  
  1598. EXIT:
  1599. END_MACRO;
  1600.  
  1601. $MACRO DEFINE_KEY TRANS;
  1602. {******************************************************************************
  1603.                                                              MULTI-EDIT MACRO
  1604.  
  1605. Name:  DEFINE_KEY
  1606.  
  1607. Description:  This macro is used by SETKEYS as a prompt for a keystroke to
  1608.                             define a key code
  1609.  
  1610. Parameters:
  1611.                             /X=        X coordinate for menu box
  1612.                             /Y=        Y coordinate for menu box
  1613.                             /STR=    Supplied by DATA_IN as the default choice
  1614.  
  1615.                              (C) Copyright 1989 by American Cybernetics, Inc.
  1616. ******************************************************************************}
  1617.  
  1618.     Def_Int(X1,Y1);
  1619.     X1 := Parse_Int('/X=',MParm_Str) + 18;
  1620.     Y1 := Parse_Int('/Y=',MParm_Str) + 6;
  1621.     RM('USERIN^XMENU /X=' + Str(X1) + '/Y=' + Str(Y1) +
  1622.         '/B=1/S=1/L=QUICKSTROKE/M=Define QuickStroke(INKE)Erase QuickStroke()');
  1623.     IF (Return_Int = 0) THEN
  1624.         Return_Str := Parse_Str('/STR=',MParm_Str);
  1625.         Goto EXIT;
  1626.     END;
  1627.  
  1628.     IF (Return_Int = 1) THEN
  1629.         Put_Box(X1,Y1,X1 + 25,Y1 + 3,0,M_B_Color,'DEFINING A QUICKSTROKE',true);
  1630.         Write('Press the desired key.',X1 + 1,Y1 + 1,0,M_B_Color);
  1631.         Read_Key;
  1632.         RM('MAKEKEY /K1=' + Str(Key1) + '/K2=' + Str(key2));
  1633.         IF (Length(Return_Str) = 1) THEN
  1634. {If the keycode is alphanumeric, need to add the <>}
  1635.             Return_Str := '<' + Return_Str + '>';
  1636.         END;
  1637.         Kill_Box;
  1638.     ELSE
  1639.         Return_Str := '';
  1640.     END;
  1641.  
  1642. EXIT:
  1643. END_MACRO;
  1644.  
  1645. $MACRO SETCOLOR TRANS;
  1646. {******************************************************************************
  1647.                                                              MULTI-EDIT MACRO
  1648.  
  1649. NAME:  SETCOLOR
  1650.  
  1651. DESCRIPTION:  This is the Color installation menu.
  1652.  
  1653.                              (C) Copyright 1989 by American Cybernetics, Inc.
  1654. ******************************************************************************}
  1655.  
  1656. {Global variables used:
  1657. Global_Int('SETUP_X1')  The X and Y coordinates of the upper left hand corner
  1658. Global_Int('SETUP_Y1')  of the main installation and setup menu box
  1659. }
  1660.     Def_Int(X1,Y1,y2,J1,jb,jx,J2,J3,Temp_Ex,old_color, j_color);
  1661.     def_int(
  1662.                      var_ofs,
  1663.                      var_seg,
  1664.                      t_w_t_color,
  1665.                      t_w_h_color,
  1666.                      t_w_c_color,
  1667.                      t_w_eof_color,
  1668.                      t_w_s_color,
  1669.                      t_w_b_color,
  1670.                      t_m_h_color,
  1671.                      t_m_t_color,
  1672.                      t_m_s_color,
  1673.                      t_m_b_color,
  1674.                      t_fkey_color,
  1675.                      t_fnum_color,
  1676.                      t_stat1_color,
  1677.                      t_stat2_color,
  1678.                      t_error_color,
  1679.                      t_message_color,
  1680.                      t_working_color,
  1681.                      t_shadow_color,
  1682.                      t_h_t_color,
  1683.                      t_h_h_color,
  1684.                      t_h_b_color,
  1685.                      t_h_s_color,
  1686.                      t_h_f_color,
  1687.                      t_h_r_color,
  1688.                      t_h_t1_color,
  1689.                      t_h_t2_color,
  1690.            t_h_t3_color,
  1691.            t_background_color
  1692.                  );
  1693.  
  1694.     Def_Str(tstr[80], gstr[4]);
  1695.     Def_Char(Shadow_Char1);
  1696.     refresh := false;
  1697.     X1 := Global_Int('SETUP_X1') - 3;
  1698.     Y1 := Global_Int('SETUP_Y1');
  1699.  
  1700. {Begin building the menu}
  1701.     y2 := y1 + 21;
  1702.     Put_Box(X1+10,Y1,X1+74,Y2,0,m_b_color,'SETUP COLORS',true);
  1703.     temp_ex := explosions;
  1704.     explosions := false;
  1705.     Put_Box(X1+11,Y1+1,X1+48,Y1+15,0,m_t_color,'SAMPLE',false);
  1706.     explosions := temp_ex;
  1707.  
  1708. {Store all current colors into variables}
  1709.     t_h_t_color := h_t_color;
  1710.     t_h_t1_color := h_t1_color;
  1711.     t_h_t2_color := h_t2_color;
  1712.     t_h_t3_color := h_t3_color;
  1713.     t_h_h_color := h_h_color;
  1714.     t_h_b_color := h_b_color;
  1715.     t_h_s_color := h_s_color;
  1716.     t_h_r_color := h_r_color;
  1717.     t_h_f_color := h_f_color;
  1718.  
  1719.     t_m_t_color := m_t_color;
  1720.     t_m_h_color := m_h_color;
  1721.     t_m_s_color := m_s_color;
  1722.     t_m_b_color := m_b_color;
  1723.  
  1724.     t_error_color   := error_color;
  1725.     t_message_color := message_color;
  1726.     t_working_color := working_color;
  1727.     t_shadow_color := shadow_color;
  1728.  
  1729.  
  1730.     t_w_t_color := w_t_color;
  1731.     t_w_h_color := w_h_color;
  1732.     t_w_c_color := w_c_color;
  1733.     t_w_eof_color := w_eof_color;
  1734.     t_w_s_color := w_s_color;
  1735.     t_w_b_color := w_b_color;
  1736.     t_fkey_color := fkey_color;
  1737.     t_fnum_color := fnum_color;
  1738.     t_stat1_color := stat1_color;
  1739.     t_stat2_color := stat2_color;
  1740.   t_background_color := background_color;
  1741.     J1 := 1;
  1742.     Shadow_Char1 := Shadow_Char;
  1743.  
  1744. COLORS_LOOP:
  1745.     call clear_menu;
  1746.     call no_message;
  1747.     write('Press       to exit color installation',x1+11,y1+19,0,m_t_color);
  1748.     call put_sample;
  1749.  
  1750. {Heres the actual color menu}
  1751.     gstr := Str(global_int('MENU_LEVEL')) + 'MSTR_';
  1752.  
  1753.   draw_outline( x1 + 51, y2 - 2 - 5, x1 + 70, y2 - 1, m_b_color );
  1754.     create_global_str(gstr + '1' ,  '/N=Window colors/H=INCO');
  1755.     create_global_str(gstr + '2' ,  '/N=Menu colors');
  1756.     create_global_str(gstr + '3' ,  '/N=Help colors');
  1757.     create_global_str(gstr + '4' ,  '/N=Other colors');
  1758.   create_global_str(gstr + '5' ,  '/N=Background color');
  1759.  
  1760.     Set_Global_Str('@INCOEV#1','/T=Exit/KC=<ESC>/K1=27/K2=1/R=1/W=9/X=' +
  1761.                                     Str(x1 + 57) + '/Y=' + Str(y1+20));
  1762.     Set_Global_Str('@INCOEV#2','/T=/KC=<ESC>/K1=27/K2=1/R=1/W=5/X=' +
  1763.                                     Str(x1 + 17) + '/Y=' + Str(y1+19));
  1764.     RM('USERIN^CheckEvents /M=2/G=@INCOEV#/#=2');
  1765.  
  1766.   RM('USERIN^SUBMENU /#=5/B=1/A=1/GCLR=1/BC=' + str(box_count) +
  1767.                                     '/S=' + str(j1) +
  1768.                   '/X=' + str(x1 + 52) + '/Y=' + str(y2 - 1 - 5) +
  1769.                                     '/G=' + gstr);
  1770.  
  1771.  
  1772.     if return_int < 1 then
  1773.         IF ((Key1 = 0) and (Key2 = 250)) THEN
  1774.             RM('USERIN^CheckEvents /M=1/G=@INCOEV#/#=2');
  1775.             WHILE (Check_Key) DO
  1776.             END;
  1777.             Key1 := 0;
  1778.             Key2 := 0;
  1779.             IF (Return_Int = 0) THEN
  1780.                 goto colors_loop;
  1781.             END;
  1782.         END;
  1783.         goto exit;
  1784.     end;
  1785.  
  1786.     call clear_menu;
  1787.     call no_message;
  1788.  
  1789.     j1 := return_int;
  1790.     if j1 = 1 then
  1791. menu1:
  1792.         draw_outline( x1 + 51, y2 - 2 - 6, x1 + 70, y2 - 1,m_b_color );
  1793.         create_global_str(gstr + '1' ,  '/N=Text/H=INCO');
  1794.         create_global_str(gstr + '2' ,  '/N=Changed-Text');
  1795.         create_global_str(gstr + '3' ,  '/N=Highlighted-Text');
  1796.         create_global_str(gstr + '4' ,  '/N=End-Of-File');
  1797.         create_global_str(gstr + '5' ,  '/N=Window-border');
  1798.         create_global_str(gstr + '6' ,  '/N=window-Bold');
  1799.         call PUT_PREVIOUS;
  1800.         RM('USERIN^SUBMENU /#=6/B=1/A=1/GCLR=1/S=' + str(jb) +
  1801.                                         '/BC=' + str(box_count) +
  1802.                                         '/X=' + str(x1 + 52) + '/Y=' + str(y2 - 1 - 6) +
  1803.                                         '/G=' + gstr);
  1804.         jb := return_int;
  1805.         if jb < 1 then
  1806.             call CHECK_MOUSE;
  1807.             goto colors_loop;
  1808.         end;
  1809.         if jb = 1 then
  1810.             var_ofs := ofs(t_w_t_color);
  1811.             var_seg := seg(t_w_t_color);
  1812.         end;
  1813.         if jb = 2 then
  1814.             var_ofs := ofs(t_w_c_color);
  1815.             var_seg := seg(t_w_c_color);
  1816.         end;
  1817.         if jb = 3 then
  1818.             var_ofs := ofs(t_w_h_color);
  1819.             var_seg := seg(t_w_h_color);
  1820.         end;
  1821.         if jb = 4 then
  1822.             var_ofs := ofs(t_w_eof_color);
  1823.             var_seg := seg(t_w_eof_color);
  1824.         end;
  1825.         if jb = 5 then
  1826.             var_ofs := ofs(t_w_b_color);
  1827.             var_seg := seg(t_w_b_color);
  1828.         end;
  1829.         if jb = 6 then
  1830.             var_ofs := ofs(t_w_s_color);
  1831.             var_seg := seg(t_w_s_color);
  1832.         end;
  1833.         call change_colors;
  1834.         call no_message;
  1835.         call put_sample;
  1836.         goto menu1;
  1837.     end;
  1838.  
  1839.     if j1 = 2 then
  1840. menu2:
  1841.         draw_outline( x1 + 51, y2 - 2 - 4, x1 + 70, y2 - 1,m_b_color );
  1842.         create_global_str(gstr + '1' , '/N=menu-Text/H=INCO');
  1843.         create_global_str(gstr + '2' , '/N=menu-Highlight');
  1844.         create_global_str(gstr + '3' , '/N=menu-Bold');
  1845.         create_global_str(gstr + '4' , '/N=Menu-border');
  1846.         call PUT_PREVIOUS;
  1847.         RM('USERIN^SUBMENU /#=4/B=1/A=1/GCLR=1/S=' + str(jb) +
  1848.                                         '/BC=' + str(box_count) +
  1849.                                         '/X=' + str(x1 + 52) + '/Y=' + str(y2 - 1 - 4) +
  1850.                                         '/G=' + gstr);
  1851.         jb := return_int;
  1852.         if jb < 1 then
  1853.             call CHECK_MOUSE;
  1854.             goto colors_loop;
  1855.         end;
  1856.         if jb = 1 then
  1857.             var_ofs := ofs(t_m_t_color);
  1858.             var_seg := seg(t_m_t_color);
  1859.         end;
  1860.         if jb = 2 then
  1861.             var_ofs := ofs(t_m_h_color);
  1862.             var_seg := seg(t_m_h_color);
  1863.         end;
  1864.         if jb = 3 then
  1865.             var_ofs := ofs(t_m_s_color);
  1866.             var_seg := seg(t_m_s_color);
  1867.         end;
  1868.         if jb = 4 then
  1869.             var_ofs := ofs(t_m_b_color);
  1870.             var_seg := seg(t_m_b_color);
  1871.         end;
  1872.         call change_colors;
  1873.         call no_message;
  1874.         call put_sample;
  1875.         goto menu2;
  1876.     end;
  1877.  
  1878.     if j1 = 3 then
  1879. menu3:
  1880.         draw_outline( x1 + 51, y2 - 2 - 9, x1 + 70, y2 - 1,m_b_color );
  1881.         create_global_str(gstr + '1' , '/N=help-Text/H=INCO');
  1882.         create_global_str(gstr + '2' , '/N=help-Highlight');
  1883.         create_global_str(gstr + '3' , '/N=help-Chapter');
  1884.         create_global_str(gstr + '4' , '/N=help-bOrder');
  1885.         create_global_str(gstr + '5' , '/N=help-Link');
  1886.         create_global_str(gstr + '6' , '/N=help-F-keys');
  1887.         create_global_str(gstr + '7' , '/N=help-attr-1');
  1888.         create_global_str(gstr + '8' , '/N=help-attr-2');
  1889.         create_global_str(gstr + '9' , '/N=help-attr-3');
  1890.         call PUT_PREVIOUS;
  1891.         RM('USERIN^SUBMENU /#=9/B=1/A=1/GCLR=1/S=' + str(jb) +
  1892.                                         '/BC=' + str(box_count) +
  1893.                                         '/X=' + str(x1 + 52) + '/Y=' + str(y2 - 1 - 9) +
  1894.                                         '/G=' + gstr);
  1895.         jb := return_int;
  1896.         if jb < 1 then
  1897.             call CHECK_MOUSE;
  1898.             goto colors_loop;
  1899.         end;
  1900.         if jb = 1 then
  1901.             var_ofs := ofs(t_h_t_color);
  1902.             var_seg := seg(t_h_t_color);
  1903.         end;
  1904.         if jb = 2 then
  1905.             var_ofs := ofs(t_h_h_color);
  1906.             var_seg := seg(t_h_h_color);
  1907.         end;
  1908.         if jb = 3 then
  1909.             var_ofs := ofs(t_h_s_color);
  1910.             var_seg := seg(t_h_s_color);
  1911.         end;
  1912.         if jb = 4 then
  1913.             var_ofs := ofs(t_h_b_color);
  1914.             var_seg := seg(t_h_b_color);
  1915.         end;
  1916.         if jb = 5 then
  1917.             var_ofs := ofs(t_h_r_color);
  1918.             var_seg := seg(t_h_r_color);
  1919.         end;
  1920.         if jb = 6 then
  1921.             var_ofs := ofs(t_h_f_color);
  1922.             var_seg := seg(t_h_f_color);
  1923.         end;
  1924.     if jb = 7 then
  1925.       var_ofs := ofs(t_h_t1_color);
  1926.       var_seg := seg(t_h_t1_color);
  1927.         end;
  1928.         if jb = 8 then
  1929.             var_ofs := ofs(t_h_t2_color);
  1930.             var_seg := seg(t_h_t2_color);
  1931.         end;
  1932.         if jb = 9 then
  1933.             var_ofs := ofs(t_h_t3_color);
  1934.             var_seg := seg(t_h_t3_color);
  1935.         end;
  1936.         call change_colors;
  1937.         call no_message;
  1938.         call put_sample;
  1939.         goto menu3;
  1940.     end;
  1941.  
  1942.  
  1943.     if j1 = 4 then
  1944. menu4:
  1945.         draw_outline( x1 + 51, y2 - 2 - 9, x1 + 70, y2 - 1,m_b_color );
  1946.         create_global_str(gstr + '1' , '/N=Statusline/H=INCO');
  1947.         create_global_str(gstr + '2' , '/N=statusline-Bold');
  1948.         create_global_str(gstr + '3' , '/N=Fkey-Labels');
  1949.         create_global_str(gstr + '4' , '/N=fkey-Numbers');
  1950.         create_global_str(gstr + '5' , '/N=Error');
  1951.         create_global_str(gstr + '6' , '/N=Message');
  1952.         create_global_str(gstr + '7' , '/N=Working');
  1953.         create_global_str(gstr + '8' , '/N=sHadow');
  1954.         create_global_str(gstr + '9' , '/N=shadow-Character');
  1955.         call PUT_PREVIOUS;
  1956.         RM('USERIN^SUBMENU /#=9/B=1/A=1/GCLR=1/S=' + str(jb) +
  1957.                                         '/BC=' + str(box_count) +
  1958.                                         '/X=' + str(x1 + 52) + '/Y=' + str(y2 - 1 - 9) +
  1959.                                         '/G=' + gstr);
  1960.         jb := return_int;
  1961.         if jb < 1 then
  1962.             call CHECK_MOUSE;
  1963.             goto colors_loop;
  1964.         end;
  1965.         if jb = 1 then
  1966.             var_ofs := ofs(t_stat1_color);
  1967.             var_seg := seg(t_stat1_color);
  1968.         end;
  1969.         if jb = 2 then
  1970.             var_ofs := ofs(t_stat2_color);
  1971.             var_seg := seg(t_stat2_color);
  1972.         end;
  1973.         if jb = 3 then
  1974.             var_ofs := ofs(t_fkey_color);
  1975.             var_seg := seg(t_fkey_color);
  1976.         end;
  1977.         if jb = 4 then
  1978.             var_ofs := ofs(t_fnum_color);
  1979.             var_seg := seg(t_fnum_color);
  1980.         end;
  1981.         if jb = 5 then
  1982.             var_ofs := ofs(t_error_color);
  1983.             var_seg := seg(t_error_color);
  1984.         end;
  1985.         if jb = 6 then
  1986.             var_ofs := ofs(t_message_color);
  1987.             var_seg := seg(t_message_color);
  1988.         end;
  1989.         if jb = 7 then
  1990.             var_ofs := ofs(t_working_color);
  1991.             var_seg := seg(t_working_color);
  1992.         end;
  1993.         if jb = 8 then
  1994.             var_ofs := ofs(t_shadow_color);
  1995.             var_seg := seg(t_shadow_color);
  1996.         end;
  1997.         if jb = 9 then
  1998.             put_box(x1 + 11, y1 + 13, x1 + 41, y1 + 20, 0, m_b_color, 'SELECT SHADOW CHARACTER',true);
  1999.             write('    |176|176|176|176', x1 + 12, y1 + 14, 0, m_s_color );
  2000.             write('    |177|177|177|177 ', x1 + 12, y1 + 15, 0, m_s_color );
  2001.             write('    |178|178|178|178',x1 + 12, y1 + 16, 0, m_s_color );
  2002.             write('    |219|219|219|219', x1 + 12, y1 + 17, 0, m_s_color );
  2003.             write('    Transparent', x1 + 12, y1 + 18, 0, m_s_color );
  2004.             RM('userin^xmenu /T=1/X=' + str(x1 + 12) + '/Y=' + str(y1+14)
  2005.                                     + '/M=1-->(INCO)2-->()3-->()4-->()5-->()');
  2006.             kill_box;
  2007.             j2 := return_int;
  2008.             if j2 > 0 then
  2009.                 Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  2010.                 shadow_char1 := char( j2 + 175 );
  2011.                 if j2 = 4 then
  2012.                     shadow_char1 :=  '|219';
  2013.                 end;
  2014.                 if j2 = 5 then
  2015.                     shadow_char1 :=  '|0';
  2016.                 end;
  2017.             end;
  2018.             call no_message;
  2019.         end;
  2020.         if jb < 9 then
  2021.             call change_colors;
  2022.         end;
  2023.         call no_message;
  2024.         call put_sample;
  2025.         goto menu4;
  2026.     end;
  2027.  
  2028.   if j1 = 5 THEN
  2029.     draw_outline( x1 + 51, y2 - 2 - 3, x1 + 70, y2 - 1,m_b_color );
  2030.     write( '    Setting', x1 + 52, y2 - 2 - 2, 0, m_t_color );
  2031.     write( 'Background color', x1 + 52, y2 - 2 - 1, 0, m_t_color );
  2032.     var_ofs := ofs(t_background_color);
  2033.     var_seg := seg(t_background_color);
  2034.     call change_colors;
  2035.     call no_message;
  2036.     call put_sample;
  2037.     call CHECK_MOUSE;
  2038.     goto colors_loop;
  2039.   END;
  2040.  
  2041.     goto colors_loop;
  2042.     goto exit;
  2043.  
  2044. clear_menu:
  2045.     jx := 9;
  2046.     while jx < 19 do
  2047.         ++jx;
  2048.     draw_char(32,x1+51,y1+jx, m_t_color, 21 );
  2049.     end;
  2050.     ret;
  2051.  
  2052. change_message:
  2053.  
  2054.     write('       to change foreground color     ',  x1 + 11,y1+17,0,m_t_color);
  2055.     write('       to change background color.    ', x1 + 11,y1+18,0,m_t_color);
  2056.     write('         to accept,       aborts      ',  x1 + 11,y1+19,0,m_t_color);
  2057.     Draw_Char(205,x1+55,y1+20,m_b_color,13);
  2058.     call write_num;
  2059.     ret;
  2060.  
  2061. no_message:
  2062.     Draw_Char(32,x1+11,y1+16,m_t_color,36);
  2063.     write('Select item from menu ────────────|16  ',x1+11,y1+17,0,m_t_color);
  2064.     Draw_Char(32,x1+11,y1+18,m_t_color,36);
  2065.   Draw_Char(32,x1+11,y1+19,m_t_color,38);
  2066.     ret;
  2067.  
  2068. CHECK_MOUSE:
  2069.     IF ((Key1 = 0) and (Key2 = 250)) THEN
  2070.         Set_Global_Str('@INCOEV#1','/T=Previous/KC=<ESC>/K1=27/K2=1/R=1/W=13/X='
  2071.                                         + Str(x1 + 55) + '/Y=' + Str(y1+20));
  2072.         RM('USERIN^CheckEvents /M=1/G=@INCOEV#/#=1');
  2073.         IF (Return_Int = 1) THEN
  2074.             WHILE (Check_Key) DO
  2075.             END;
  2076.             Key1 := 0;
  2077.             Key2 := 0;
  2078.         END;
  2079.     END;
  2080.     Ret;
  2081.  
  2082. put_previous:
  2083.     Set_Global_Str('@INCOEV#1','/T=Previous/KC=<ESC>/K1=27/K2=1/R=1/W=13/X=' +
  2084.                                     Str(x1 + 55) + '/Y=' + Str(y1+20));
  2085.     RM('USERIN^CheckEvents /M=2/G=@INCOEV#/#=1');
  2086.     ret;
  2087.  
  2088. write_num:
  2089.     write('Foreground = ' + str(j_color and $0f) + ' Background = ' + str(j_color shr 4) + '    ', x1 + 11, y1 + 16, 0, m_t_color);
  2090.     ret;
  2091.  
  2092. change_colors:
  2093.             j_color := peek(var_seg,var_ofs);
  2094.             old_color := j_color;
  2095.             call change_message;
  2096.             loopj1:
  2097.                 Set_Global_Str('@INCOEV#1','/T= /KC=<ESC>/K1=27/K2=1/R=1/W=7/X=' +
  2098.                                                 Str(x1 + 30) + '/Y=' + Str(y1+19));
  2099.                 Set_Global_Str('@INCOEV#2','/T= /KC=<ENTER>/K1=13/K2=28/R=2/W=9/X=' +
  2100.                                                 Str(x1 + 11) + '/Y=' + Str(y1+19));
  2101.                 Set_Global_Str('@INCOEV#3','/T= /KC= /K1=0/K2=72/R=3/W=3/X=' +
  2102.                         Str(x1 + 14) + '/Y=' + Str(y1+17));
  2103.                 Set_Global_Str('@INCOEV#4','/T= /KC= /K1=0/K2=80/R=4/W=3/X=' +
  2104.                         Str(x1 + 11) + '/Y=' + Str(y1+17));
  2105.                 Set_Global_Str('@INCOEV#5','/T= /KC=|27 /K1=0/K2=75/R=5/W=3/X=' +
  2106.                                                 Str(x1 + 11) + '/Y=' + Str(y1+18));
  2107.                 Set_Global_Str('@INCOEV#6','/T= /KC= /K1=0/K2=77/R=6/W=3/X=' +
  2108.                                                 Str(x1 + 14) + '/Y=' + Str(y1+18));
  2109.                 RM('USERIN^CheckEvents /M=2/G=@INCOEV#/#=6');
  2110.                 read_key;
  2111.                 if key1 = 13 then
  2112. ENTER:
  2113.                     Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  2114.                     ret;
  2115.                 end;
  2116.                 if key1 = 27 then
  2117. ESCAPE:
  2118.                     poke( var_seg, var_ofs, old_color);
  2119.                     ret;
  2120.                 end;
  2121.  
  2122.                 if key1 = 0 then
  2123.                     IF (Key2 = 250) THEN
  2124.                         RM('USERIN^CheckEvents /M=1/G=@INCOEV#/#=6');
  2125.                         IF (Return_Int = 1) THEN
  2126.                             Goto ESCAPE;
  2127.                         ELSIF (Return_Int = 2) THEN
  2128.                             Goto ENTER;
  2129.                         ELSIF (Return_Int = 3) THEN
  2130.                             Goto UP_ARROW;
  2131.                         ELSIF (Return_Int = 4) THEN
  2132.                             Goto DOWN_ARROW;
  2133.                         ELSIF (Return_Int = 5) THEN
  2134.                             Goto LEFT_ARROW;
  2135.                         ELSIF (Return_Int = 6) THEN
  2136.                             Goto RIGHT_ARROW;
  2137.                         END;
  2138.                     END;
  2139.                     if key2 = 72 then
  2140. UP_ARROW:
  2141.                         j3 := j_color and $0f;
  2142.                         ++j3;
  2143.                         j_color := (j_color and $f0) or (j3 and $0f);
  2144.                     end;
  2145.                     if key2 = 80 then
  2146. DOWN_ARROW:
  2147.                         j3 := j_color and $0f;
  2148.                         --j3;
  2149.                         j_color := (j_color and $f0) or (j3 and $0f);
  2150.                     end;
  2151.                     if key2 = 77 then
  2152. RIGHT_ARROW:
  2153.                         j3 := (j_color and $f0) shr 4;
  2154.                         ++j3;
  2155.                         j_color := (j_color and $0f) or ((j3 and $0f) shl 4);
  2156.                     end;
  2157.                     if key2 = 75 then
  2158. LEFT_ARROW:
  2159.                         j3 := (j_color and $f0) shr 4;
  2160.                         --j3;
  2161.                         j_color := (j_color and $0f) or ((j3 and $0f) shl 4);
  2162.                     end;
  2163.                 end;
  2164.                 call write_num;
  2165.                 poke( var_seg, var_ofs, j_color);
  2166.                 call put_sample;
  2167.                 goto loopj1;
  2168.  
  2169.  
  2170. put_sample:
  2171.     {Create a sample section of the main Multi-Edit display to show the
  2172.         colors with}
  2173.     Write('L:      C:      [         ]',x1+12,y1+2,0,t_stat1_color);
  2174.     Write(' WORKING ',x1+29,y1+2,0,t_working_color);
  2175.     Write('128', x1 + 14, y1 + 2, 0,t_stat2_color);
  2176.     Write('12', x1 + 22, y1 + 2, 0,t_stat2_color);
  2177.     Write( ' A fun message...  ',x1+12,y1+3,0,t_message_color);
  2178.     Write( ' A fun error...  ',x1+31,y1+3,0,t_Error_color);
  2179.  
  2180.  
  2181.   Write( '╔═╕ ╒════════════════════════════',x1+15,y1+4,0,t_w_b_color);
  2182.   Write( '*',x1+16,y1+4,0, t_w_s_color);
  2183.   Write( 'A',x1+18,y1+4,0, t_w_s_color);
  2184.     Write( 'C:\TEST.TXT',x1+37,y1+4,0, t_w_s_color);
  2185.   Write( 'This is ',x1+16,y1+05,0,t_w_t_color);
  2186.   Write( 'This is ',x1+16,y1+06,0,t_w_t_color);
  2187.   Write( 'This is ',x1+16,y1+07,0,t_w_t_color);
  2188.   Write( 'This is sa',x1+16,y1+08,0,t_w_t_color);
  2189.   Write( 'This is changed text.  This is c',x1+16,y1+9,0,t_w_c_color);
  2190.   Write( 'This is sample text.  This is sa',x1+16,y1+10,0,t_w_t_color);
  2191.   Write( 'This is block highlighted text. ',x1+16,y1+11,0,t_w_h_color);
  2192.   Write( '>>EOF<<                         ',x1+16,y1+12,0,t_w_eof_color);
  2193.   Write( '║',x1+15,y1+05,0,t_w_b_color);
  2194.   Write( '║',x1+15,y1+06,0,t_w_b_color);
  2195.   Write( '║',x1+15,y1+07,0,t_w_b_color);
  2196.   Write( '║',x1+15,y1+08,0,t_w_b_color);
  2197.   Write( '║',x1+15,y1+09,0,t_w_b_color);
  2198.   Write( '║',x1+15,y1+10,0,t_w_b_color);
  2199.   Write( '║',x1+15,y1+11,0,t_w_b_color);
  2200.   Write( '║',x1+15,y1+12,0,t_w_b_color);
  2201.   Write( '▒▒▒',x1+12,y1+04,0,t_background_color);
  2202.   Write( '▒▒▒',x1+12,y1+05,0,t_background_color);
  2203.   Write( '▒▒▒',x1+12,y1+06,0,t_background_color);
  2204.   Write( '▒▒▒',x1+12,y1+07,0,t_background_color);
  2205.   Write( '▒▒▒',x1+12,y1+08,0,t_background_color);
  2206.   Write( '▒▒▒',x1+12,y1+9,0,t_background_color);
  2207.   Write( '▒▒▒',x1+12,y1+10,0,t_background_color);
  2208.   Write( '▒▒▒',x1+12,y1+11,0,t_background_color);
  2209.   Write( '▒▒▒',x1+12,y1+12,0,t_background_color);
  2210.   Write( '▒▒▒',x1+12,y1+13,0,t_background_color);
  2211.  
  2212.                             Write( '┌────────────────────BOX',x1+24,y1+05,0,t_m_b_color);
  2213.                             Write( '│',x1+24,y1+06,0,t_m_b_color);
  2214.                             write(  '                       ',x1+25,y1+06,0,t_m_t_color);
  2215.                             Write( '╘═══════════════════════',x1+24,y1+07,0,t_m_b_color);
  2216.  
  2217.     if shadow_char1 = '|0' then
  2218.     tstr := 'mple.  This is sample.';
  2219.     else
  2220.         j3 := 0;
  2221.         tstr := '';
  2222.         while j3 < 22 do
  2223.             tstr := tstr + shadow_char1;
  2224.             ++j3;
  2225.         end;
  2226.     end;
  2227.                             Write( tstr,x1+26,y1+08,0,t_shadow_color);
  2228.  
  2229.                              Write( 'Window Menu File Block',x1+25,y1+6,0,t_m_t_color);
  2230.     Write( 'Window',x1+25,y1+6,0,t_m_h_color);
  2231.     Write('M',x1+32,y1+6,0,t_m_s_color);
  2232.     Write('F',x1+37,y1+6,0,t_m_s_color);
  2233.     Write('B',x1+42,y1+6,0,t_m_s_color);
  2234.  
  2235.  
  2236.   Write( '╚════════════════════════════════',x1+15,y1+13,0,t_w_b_color);
  2237.     Write( '1',x1+12,y1+14,0,t_fnum_color);
  2238.     Write( 'Help  ',x1+13,y1+14,0,t_fkey_color);
  2239.     Write( ' 2',x1+19,y1+14,0,t_fnum_color);
  2240.     Write( 'Menu  ',x1+21,y1+14,0,t_fkey_color);
  2241.     Write( ' 3',x1+27,y1+14,0,t_fnum_color);
  2242.     Write( 'Save  ',x1+29,y1+14,0,t_fkey_color);
  2243.     Write( ' 4',x1+35,y1+14,0,t_fnum_color);
  2244.     Write( 'Indent',x1+37,y1+14,0,t_fkey_color);
  2245.     Write( ' 5',x1+43,y1+14,0,t_fnum_color);
  2246.     Write( 'Mar',x1+45,y1+14,0,t_fkey_color);
  2247.  
  2248.  
  2249.     draw_outline( x1 + 50, y1 + 1, x1 + 71, y1 + 09, t_h_b_color);
  2250.     write('SAMPLE HELP', x1 + 55, y1 + 1, 0, t_h_b_color);
  2251.     Write('  CHAPTER HEADING   ', x1 + 51, y1 + 2, 0, t_h_s_color);
  2252.     Write('This is help text.  ', x1 + 51, y1 + 3, 0, t_h_t_color);
  2253.     Write('This is a           ', x1 + 51, y1 + 4, 0, t_h_t_color);
  2254.     Write('LINK', x1 + 61, y1 + 4, 0, t_h_r_color);
  2255.     Write('Highlighted         ', x1 + 51, y1 + 5, 0, t_h_t_color);
  2256.     Write('LINK', x1 + 63, y1 + 5, 0, t_h_h_color);
  2257.     Write('This is attribute 1 ', x1 + 51, y1 + 6, 0, t_h_t1_color);
  2258.     Write('This is attribute 2 ', x1 + 51, y1 + 7, 0, t_h_t2_color);
  2259.     Write('This is attribute 3 ', x1 + 51, y1 + 8, 0, t_h_t3_color);
  2260.     Write('<F1>Index,<F6>Search,<', x1 + 50, y1 + 9, 0, t_h_f_color);
  2261.     ret;
  2262.  
  2263. exit:
  2264. {Now, change the current colors to the new colors and get out}
  2265.     kill_box;
  2266.     Kill_Box;
  2267.     Kill_Box;
  2268.  
  2269.  
  2270.     m_t_color := t_m_t_color;
  2271.     m_h_color := t_m_h_color;
  2272.     m_b_color := t_m_b_color;
  2273.     m_s_color := t_m_s_color;
  2274.  
  2275.     h_t_color := t_h_t_color;
  2276.     h_h_color := t_h_h_color;
  2277.     h_b_color := t_h_b_color;
  2278.     h_s_color := t_h_s_color;
  2279.     h_r_color := t_h_r_color;
  2280.     h_f_color := t_h_f_color;
  2281.     h_t1_color := t_h_t1_color;
  2282.     h_t2_color := t_h_t2_color;
  2283.     h_t3_color := t_h_t3_color;
  2284.  
  2285.     error_color   := t_error_color;
  2286.     message_color := t_message_color;
  2287.     working_color := t_working_color;
  2288.     shadow_color := t_shadow_color;
  2289.     shadow_char := shadow_char1;
  2290.  
  2291.     w_t_color := t_w_t_color;
  2292.     w_h_color := t_w_h_color;
  2293.     w_c_color := t_w_c_color;
  2294.     w_eof_color := t_w_eof_color;
  2295.     w_s_color := t_w_s_color;
  2296.     w_b_color := t_w_b_color;
  2297.  
  2298.     d_t_color := m_t_color;
  2299.     d_h_color := m_h_color;
  2300.     d_s_color := m_s_color;
  2301.     d_b_color := m_b_color;
  2302.  
  2303.  
  2304.     fkey_color := t_fkey_color;
  2305.     fnum_color := t_fnum_color;
  2306.     stat1_color := t_stat1_color;
  2307.     stat2_color := t_stat2_color;
  2308.   background_color := t_background_color;
  2309.  
  2310.     j1 := 0;
  2311.     j2 := cur_window;
  2312.     while j1 < window_count do
  2313.         ++j1;
  2314.         switch_window(j1);
  2315.         if window_color_stat = 0 then
  2316.             t_color := w_t_color;
  2317.             h_color := w_h_color;
  2318.             eof_color := w_eof_color;
  2319.             s_color := w_s_color;
  2320.             b_color := w_b_color;
  2321.             c_color := w_c_color;
  2322.         end;
  2323.     end;
  2324.     switch_window( j2 );
  2325.     return_int := 0;
  2326.  
  2327. END_MACRO;
  2328.  
  2329. $MACRO DISPLAY_SETUP TRANS;
  2330. {******************************************************************************
  2331.                                                              MULTI-EDIT MACRO
  2332.  
  2333. Name:  DISPLAY_SETUP
  2334.  
  2335. Description:    The display configuration menu
  2336.  
  2337. Parameters:
  2338.                             /BC= Amount of boxes on the screen before this macro is called
  2339.                                      so it can clean up after it'self.
  2340.  
  2341.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2342. ******************************************************************************}
  2343.  
  2344.     def_str( gstr[20], bstr[10] );
  2345.     def_int( tbc );
  2346.     gstr := '!DSET!_';
  2347.     tbc := parse_int('/BC=', mparm_str);
  2348.  
  2349.     bstr := '';
  2350. display_setup_loop:
  2351.     refresh := false;
  2352.     {Create_Global_Str(gstr+'1','/H=INCO');}
  2353.     Create_Global_Str(gstr+'X1','Colors...');
  2354.     Create_Global_Str(gstr+'2','/M=SCRSTYLE');
  2355.     Create_Global_Str(gstr+'X2','Screen layouts...');
  2356.  {Create_Global_Str(gstr+'3','/H=INVI');}
  2357.     Create_Global_Str(gstr+'X3','Video mode toggle');
  2358.     {Create_Global_Str(gstr+'4','/H=INEX');}
  2359.     Create_Global_Str(gstr+'X4','Explosions         ^' +
  2360.             copy( 'No Yes', (Explosions <> 0) * 3 + 1, 3) );
  2361.     {Create_Global_Str(gstr+'5','/H=INCT');}
  2362.     Create_Global_Str(gstr+'X5','ctrl Help box      ^' +
  2363.             copy( 'No Yes', (Ctrl_Help <> 0) * 3 + 1, 3) );
  2364.     {Create_Global_Str(gstr+'6','/H=INLO');}
  2365.     Create_Global_Str(gstr+'X6','Logo screen        ^' +
  2366.             copy( 'No Yes', (Logo_Screen <> 0) * 3 + 1, 3) );
  2367. do_xmenu:
  2368.     RM('USERIN^SUBMENU /H=INDS/GCLR=1/#=6/M=' + gstr + 'X' + '/S=' +global_str(gstr+'0') +'/L=DISPLAY SETUP/G=' + gstr + bstr + MParm_Str);
  2369.     bstr := '/B=1/BO=1';
  2370.     IF RETURN_INT = 1 THEN
  2371.         RM( 'SETCOLOR' );
  2372.         CALL DO_KILL_BOXES;
  2373.         RETURN_INT := 1000;
  2374.         GOTO EXIT;
  2375.     ELSIF RETURN_INT = 3 THEN
  2376.         CALL DO_KILL_BOXES;
  2377.         RM( 'TGLVID' );
  2378.         call set_changed;
  2379.         RETURN_INT := 1000;
  2380.         GOTO exit;
  2381.     ELSIF RETURN_INT = 4 THEN
  2382.         Explosions := NOT( Explosions );
  2383.         call set_changed;
  2384.     ELSIF RETURN_INT = 5 THEN
  2385.         Ctrl_Help := NOT( Ctrl_Help );
  2386.         call set_changed;
  2387.     ELSIF RETURN_INT = 6 THEN
  2388.         Logo_Screen := NOT( logo_screen );
  2389.         call set_changed;
  2390.     ELSIF RETURN_INT <= 0 THEN
  2391.         GOTO EXIT;
  2392.     END;
  2393.  
  2394.     GOTO display_setup_loop;
  2395.  
  2396. set_changed:
  2397.         Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  2398.         ret;
  2399.  
  2400. DO_KILL_BOXES:
  2401.     WHILE (box_count > tbc) DO
  2402.         kill_box;
  2403.     END;
  2404.     RET;
  2405.  
  2406. EXIT:
  2407.     ++tbc;
  2408.     call DO_KILL_BOXES;
  2409.  
  2410. END_MACRO;
  2411.  
  2412. $MACRO SRCHSET TRANS;
  2413. {*******************************MULTI-EDIT MACRO******************************
  2414.  
  2415. Name: SRCHSET
  2416.  
  2417. Description:    Setup routine for default search/search and replace/multi-file
  2418.                             search settings.
  2419.  
  2420. Parameters:
  2421.                             /Y=        Y coordinate for menu box
  2422.  
  2423. Global Strings Modified:
  2424.                             'DEF_SWITCHES'
  2425.                             'DEF_REPL_SWITCHES'
  2426.                             'DEF_FS_SWITCHES'
  2427.                             'DEF_FS_PATH'
  2428.  
  2429.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2430. ******************************************************************************}
  2431.  
  2432.         def_int( use_reg_exp, case_sensitive, search_dirs, y1,x1,jx );
  2433.         def_str( switches_str[40], temp_return );
  2434.  
  2435.         temp_return := return_str;
  2436.         y1 := parse_int('/Y=', mparm_str);
  2437.         x1 := parse_int('/X=', mparm_str);
  2438.         if x1 = 0 THEN
  2439.             x1 := 2;
  2440.         END;
  2441.         if y1 = 0 then
  2442.             y1 := 2;
  2443.         end;
  2444.         jx := 1;
  2445. loop:
  2446.         RM('XMENU /T=1/B=1/L=SEARCH DEFAULTS SETUP/S=' + str(jx) + '/X=' + str(x1) + '/Y=' + str(y1) + '/M=Search defaults()search and Replace defaults()Multi-file search defaults()');
  2447.         jx := return_int;
  2448.         IF return_int < 1 THEN
  2449.             goto exit;
  2450.         ELSIF return_int = 1 THEN
  2451.             RM('MEUTIL2^SrchIntr /M=0/SWONLY=1/SWG=DEF_SWITCHES/H=INEDSE/X=' + str(x1) + '/Y=' + str(y1) );
  2452.         ELSIF return_int = 2 THEN
  2453.             RM('MEUTIL2^SrchIntr /M=1/SWONLY=1/SWG=DEF_REPL_SWITCHES/H=INEDSE/X=' + str(x1) + '/Y=' + str(y1) );
  2454.         ELSIF return_int = 3 THEN
  2455.             switches_str := global_str('DEF_FS_SWITCHES');
  2456.  
  2457.             use_reg_exp := xpos('R',switches_str, 1) <> 0;
  2458.             case_sensitive := xpos('C',switches_str, 1) <> 0;
  2459.             search_dirs := xpos('S',switches_str, 1) <> 0;
  2460.  
  2461.             Set_Global_Int('SRIINT_1',search_dirs);
  2462.             Set_Global_Str('SRISTR_1','/T=X');
  2463.             Set_Global_Str('SRIPARM_1','/T=Search Subdirectories:  /C=1/W=1/TP=5');
  2464.             Set_Global_Str('SRISTR_2',global_str('DEF_FS_PATH'));
  2465.             Set_Global_Str('SRIPARM_2','/T=Starting path:          /C=1/W=40');
  2466.             Set_Global_Int('SRIINT_3',case_sensitive);
  2467.             Set_Global_Str('SRISTR_3','/T=X');
  2468.             Set_Global_Str('SRIPARM_3','/T=Case Sensitivity:       /C=1/W=1/TP=5');
  2469.             Set_Global_Int('SRIINT_4',use_reg_exp);
  2470.             Set_Global_Str('SRISTR_4','/T=X');
  2471.             Set_Global_Str('SRIPARM_4','/T=Use Regular Expressions:/C=1/W=1/TP=5');
  2472.  
  2473.             RM('UserIn^Data_In /PRE=SR/H=INEDSE/S=1/A=2/#=4/X=10/T=MULTI-FILE SEARCH SETUP/Y=' + str(y1));
  2474.  
  2475.             search_dirs := global_int('SRIINT_1');
  2476.             set_global_str('DEF_FS_PATH', global_str('SRISTR_2'));
  2477.             case_sensitive := global_int('SRIINT_3');
  2478.             use_reg_exp := global_int('SRIINT_4');
  2479.  
  2480.             set_global_str('SRISTR_1','');
  2481.             set_global_str('SRISTR_2','');
  2482.             set_global_str('SRISTR_3','');
  2483.             set_global_str('SRISTR_4','');
  2484.  
  2485.             switches_str := '';
  2486.             if use_reg_exp then
  2487.                 switches_str := 'R';
  2488.             end;
  2489.             if case_sensitive then
  2490.                 switches_str := switches_str + 'C';
  2491.             end;
  2492.             if search_dirs then
  2493.                 switches_str := switches_str + 'S';
  2494.             end;
  2495.  
  2496.             set_Global_Str('DEF_FS_SWITCHES', switches_str);
  2497.             Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  2498.         END;
  2499.         goto loop;
  2500. exit:
  2501.         return_str := temp_return;
  2502. END_MACRO;
  2503.  
  2504.  
  2505.  
  2506. $MACRO SETEDIT TRANS;
  2507. {******************************************************************************
  2508.                                                              MULTI-EDIT MACRO
  2509.  
  2510. Name:  SETEDIT
  2511.  
  2512. Description:    This is the edit settings menu.
  2513.  
  2514. Parameters:
  2515.                             /X=        X coordinate for menu box
  2516.                             /Y=        Y coordinate for menu box
  2517.  
  2518.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2519. ******************************************************************************}
  2520. {Global variables used:
  2521. Global_Int('Default_Insert_Mode') The insert mode upon startup of editor
  2522. Global_Str('Def_Switches') The search switches upon startup of editor
  2523. Global_Str('Format_Code_Delimit') The print formatter code delimiter
  2524. }
  2525.     Def_Int(X1,Y1);
  2526.  
  2527.     X1 := parse_int('/X=', mparm_str );
  2528.     Y1 := parse_int('/Y=', mparm_str );
  2529.  
  2530.     Set_Global_Str('SEISTR_1', page_str);
  2531.     Set_Global_Str('SEIPARM_1','/T=Page break string......../C=1/TP=0/W=10/L=1/H=INEDPA');
  2532.     Set_Global_Int('SEIINT_2', truncate_spaces);
  2533.     Set_Global_Str('SEISTR_2','/T=YES/F=NO');
  2534.     Set_Global_Str('SEIPARM_2','/T=Truncate spaces........../C=1/W=3/H=INEDTR/L=2/TP=5');
  2535.  
  2536.     Set_Global_Str('SEISTR_3', 'Setup autosave');
  2537.     Set_Global_Str('SEIPARM_3','/T=/C=0/TP=8/W=14/ML=0/L=3/M=SETUP_AUTO');
  2538. {
  2539.     Set_Global_Int('SEIINT_3', parse_int('/T=', global_str('@AUTOSAVEPARMS')) );
  2540.     Set_Global_Str('SEIPARM_3','/T=Autosave time (0 = OFF)../C=1/TP=1/W=3/L=3/H=INEDAU/MIN=0/MAX=254');
  2541. }
  2542.     Set_Global_Str('SEISTR_4', '/T=INSERT/F=OVERWRITE' );
  2543.     Set_Global_Int('SEIINT_4', Global_Int('Default_Insert_Mode') );
  2544.     Set_Global_Str('SEIPARM_4','/T=Default mode............./C=1/TP=5/W=10/L=4/H=INEDDE');
  2545.     Set_Global_Int('SEIINT_5', tab_expand );
  2546.     Set_Global_STR('SEISTR_5', '/T=TABS/F=SPACES' );
  2547.     Set_Global_Str('SEIPARM_5','/T=Tab expand.............../C=1/TP=5/W=10/L=5/H=INEDTA');
  2548.     Set_Global_Int('SEIINT_6', ins_cursor + 1 );
  2549.     Set_Global_STR('SEISTR_6', 'Underline  _()1/2 block  ▄()2/3 block  ▄()Full block █()' );
  2550.     Set_Global_Str('SEIPARM_6','/T=Insert cursor............/C=1/TP=3/W=10/L=6/H=INEDIN');
  2551.     Set_Global_Int('SEIINT_7', ovr_cursor + 1 );
  2552.     Set_Global_STR('SEISTR_7', 'Underline  _()1/2 block  ▄()2/3 block  ▄()Full block █()' );
  2553.     Set_Global_Str('SEIPARM_7','/T=Overwrite cursor........./C=1/TP=3/W=10/L=7/H=INEDIN');
  2554. {Specchar and dlbparen properly represent unprintable ASCII codes in the menu}
  2555.     RM( 'userin^SPECCHAR ' + Word_Delimits );
  2556.     Set_Global_Str('SEISTR_8', return_str);
  2557.     Set_Global_Str('SEIPARM_8','/T=Word delimits............/C=1/TP=0/W=20/ML=40/L=8/H=INEDWO');
  2558.     Set_Global_Str('SEISTR_9', 'Search Settings');
  2559.     Set_Global_Str('SEIPARM_9','/T=/C=0/TP=8/W=40/ML=0/L=9/H=INEDSE/M=SRCHSET');
  2560.     Set_Global_Str('SEISTR_10', Global_Str('Format_Code_Delimit'));
  2561.     Set_Global_Str('SEIPARM_10','/T=Print formatter code...../C=1/TP=0/W=1/ML=1/L=10/H=INEDFO');
  2562.     Set_Global_INT('SEIINT_11', max_undo);
  2563.     Set_Global_Str('SEIPARM_11','/T=Max undo count.........../C=1/TP=1/W=5/ML=5/L=11/H=INEDMA/MIN=0/MAX=32367');
  2564.     Set_Global_Str('SEISTR_12', 'Set Key Repeat Speed');
  2565.     Set_Global_Str('SEIPARM_12','/T=/C=0/TP=8/W=40/ML=0/L=12/H=INEDKE/M=KEYSPEED');
  2566.     Set_Global_Int('SEIINT_13', ctrl_z );
  2567.     Set_Global_STR('SEISTR_13', '/T=Yes/F=No' );
  2568.     Set_Global_Str('SEIPARM_13','/T=Control-Z at EOF........./C=1/TP=5/W=3/L=13/H=INEDCT');
  2569.     Set_Global_STR('SEISTR_14', '/T=Yes/F=No' );
  2570.     Set_Global_Int('SEIINT_14', eof_cr );
  2571.     Set_Global_Str('SEIPARM_14','/T=CR//LF at EOF............./C=1/TP=5/W=3/L=14/H=INEDEOFCR');
  2572.     Set_Global_STR('SEISTR_15', '/T=Delete space/F=Leave space' );
  2573.     Set_Global_Int('SEIINT_15', column_move_style );
  2574.     Set_Global_Str('SEIPARM_15','/T=Column block move style../C=1/TP=5/W=12/L=15/H=INEDCBLKST');
  2575.  
  2576.     RM('UserIn^Data_In /H=INED/PRE=SE/S=1/A=2/#=15/T=EDIT SETTINGS/X=' + str(x1) + '/Y=' + str(y1));
  2577.     Page_Str := Global_Str( 'SEISTR_1' );
  2578.     Truncate_Spaces := Global_Int( 'SEIINT_2' );
  2579. {
  2580.     RM('SetAutoSave /T=' + str( Global_Int( 'SEIINT_3' )));
  2581. }
  2582.     Set_Global_Int( 'Default_Insert_Mode', Global_Int( 'SEIINT_4' ));
  2583.     Tab_Expand := Global_Int( 'SEIINT_5' );
  2584.     Ins_Cursor := Global_Int( 'SEIINT_6' ) - 1;
  2585.     Ovr_Cursor := Global_Int( 'SEIINT_7' ) - 1;
  2586.     RM('USERIN^VALCHAR ' + Global_Str( 'SEISTR_8' ) );
  2587.     word_delimits := return_str;
  2588.     Set_Global_Str( 'FORMAT_CODE_DELIMIT', Global_Str( 'SEISTR_10' ));
  2589.     Max_Undo := Global_Int( 'SEIINT_11' );
  2590.     ctrl_z := Global_Int( 'SEIINT_13' );
  2591.     eof_cr := Global_Int( 'SEIINT_14' );
  2592.     column_move_style := Global_Int( 'SEIINT_15' );
  2593.  
  2594. set_changed:
  2595.         Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  2596.  
  2597.     x1 := 1;
  2598.     WHILE x1 < 16 DO
  2599.         set_global_str( 'SESTR_' + str(x1), '' );
  2600.         set_global_int( 'SEINT_' + str(x1), 0 );
  2601.         ++x1;
  2602.     END;
  2603. END_MACRO;
  2604.  
  2605. $MACRO SETMEPATHS TRANS;
  2606. {******************************************************************************
  2607.                                                              MULTI-EDIT MACRO
  2608.  
  2609. Name:  SETMEPATHS
  2610.  
  2611. Description:  This menu sets up the backup methods, and backup and
  2612.     temp file paths
  2613.  
  2614. Parameters:
  2615.                             /X=        X coordinate for menu box
  2616.                             /Y=        Y coordinate for menu box
  2617.  
  2618.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2619. ******************************************************************************}
  2620.  
  2621.     Def_Int(X1,Y1);
  2622.  
  2623.     X1 := parse_int('/X=', mparm_str );
  2624.     Y1 := parse_int('/Y=', mparm_str );
  2625.  
  2626. {Build a menu with current settings}
  2627.  
  2628.     Set_Global_Str('ISTR_1','Off()Create .BAK file()Copy file to backup directory()');
  2629.     Set_Global_Int('IINT_1', backups + 1 );
  2630.     Set_Global_Str('IPARM_1','/T=BACKUP METHOD:/C=1/TP=3/W=30/L=1/H=INEDBA');
  2631.     Set_Global_STR('ISTR_2', backup_path );
  2632.     Set_Global_Str('IPARM_2','/T=Backup directory:/C=1/W=25/ML=80/TP=0/L=2');
  2633.     Set_Global_STR('ISTR_3', temp_path );
  2634.     Set_Global_Str('IPARM_3','/T=Temporary file directory:/C=1/W=25/ML=80/TP=0/L=3');
  2635.  
  2636.     RM('UserIn^Data_In /H=INEDBA/S=1/A=2/#=3/T=BACKUPS // DIRECTORIES/X=' + str(x1) + '/Y=' + str(y1));
  2637.  
  2638.     IF (backups <> (Global_Int( 'IINT_1' ) - 1)) OR
  2639.             (backup_path <> Global_Str('ISTR_2')) OR
  2640.             (temp_path <> Global_Str('ISTR_3')) THEN
  2641.         Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  2642.     END;
  2643.  
  2644.     backups := Global_Int( 'IINT_1' ) - 1;
  2645.     backup_path := Global_Str('ISTR_2');
  2646.     temp_path := Global_Str('ISTR_3');
  2647.  
  2648.     return_int := 0;
  2649.  
  2650. END_MACRO;
  2651.  
  2652.  
  2653.  
  2654. $MACRO SETMOUSE TRANS;
  2655. {******************************************************************************
  2656.                                                              MULTI-EDIT MACRO
  2657.  
  2658. Name:  SETMOUSE
  2659.  
  2660. Description:  This is the mouse settings menu.
  2661.  
  2662. Parameters:
  2663.                             /X=        X coordinate for menu box
  2664.                             /Y=        Y coordinate for menu box
  2665.  
  2666.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2667. ******************************************************************************}
  2668.  
  2669.     def_str( tstr[80] );
  2670.     def_int( sensitivity );
  2671.  
  2672.     tstr := global_str('@MOUSEPARMS');
  2673.     sensitivity := parse_int('/S=', tstr );
  2674.     Set_Global_Str('ISTR_1','/F=Off/T=On');
  2675.     Set_Global_Int('IINT_1', mouse);
  2676.     Set_Global_Str('IPARM_1','/T=Mouse is............................................./TP=5/C=1/W=4');
  2677.     Set_Global_Int('IINT_2', sensitivity );
  2678.     Set_Global_Str('IPARM_2','/T=Mouse sensitivity [0(Default), 1(slow)..100(fast)].../MIN=0/MAX=100/TP=1/L=3/C=1/W=4');
  2679.     Set_Global_Str('ISTR_3','/F=No/T=Yes');
  2680.     Set_Global_Int('IINT_3', mou_disappear);
  2681.     Set_Global_Str('IPARM_3','/T=Turn mouse cursor off when keyboard is used........../TP=5/C=1/W=4');
  2682.     Run_Macro( 'USERIN^Data_In /H=INMO/#=3/S=1/A=2/T=MOUSE SETUP' + '/X=' + parse_str('/X=', mparm_str) +
  2683.                                     '/Y=' + parse_str('/Y=', mparm_str )
  2684.                          );
  2685.  
  2686.     IF mouse <> global_int('IINT_1') THEN
  2687.         mouse := global_int('IINT_1');
  2688.         call set_changed;
  2689.     END;
  2690.     IF mou_disappear <> global_int('IINT_3') THEN
  2691.         call set_changed;
  2692.         mou_disappear := global_int('IINT_3');
  2693.     END;
  2694.     IF (sensitivity <> global_int('IINT_2')) THEN
  2695.         call set_changed;
  2696.         sensitivity := global_int('IINT_2');
  2697.         IF mou_installed and (sensitivity <> 0) THEN
  2698.             r_bx := sensitivity;
  2699.             r_cx := sensitivity;
  2700.             r_dx := sensitivity;
  2701.             r_ax := 26;
  2702.             intr($33);
  2703.         END;
  2704.     END;
  2705.     set_global_str('@MOUSEPARMS', '/S=' + str(sensitivity) );
  2706.     return_int := 0;
  2707.     goto exit;
  2708.  
  2709. set_changed:
  2710.     Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  2711.     ret;
  2712.  
  2713. exit:
  2714. END_MACRO;
  2715.  
  2716. $MACRO PRTTYPE TRANS;
  2717. {******************************************************************************
  2718.                                                              MULTI-EDIT MACRO
  2719.  
  2720. NAME:  PRTTYPE
  2721.  
  2722. DESCRIPTION:  This is the printer type menu.
  2723.  
  2724.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2725. ******************************************************************************}
  2726.  
  2727.     Def_Str(Old_Printer[2048]);
  2728. {
  2729.     Set_Global_Str('PRNIHELP3','/C=2/L=2/H=Code name    Format code           Printer control code');
  2730. }
  2731.     Old_Printer := Global_Str('Printer_type');
  2732.     RM('USERIN^DB /GLO=PRINTER_TYPE/LO=2/PRE=PRN/NOALPHA=1/ENC=1/F=' +
  2733.         'PRINTERS.DB/LT=SELECT A PRINTER TYPE/DT=PRINTER DRIVER SETUP/H=INPR'
  2734.              + mparm_str);
  2735. {
  2736.     Set_Global_Str('PRNIHELP3','');
  2737. }
  2738.     IF (Old_Printer <> Global_Str('Printer_type')) THEN
  2739.         Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
  2740.     END;
  2741. {Reload printer type into the global just in case there were changes made to
  2742. the printer codes}
  2743.     RM('USERIN^DB /F=PRINTERS.DB/GLO=PRINTER_TYPE/RR=1/FV=' +
  2744.             Parse_Str('PT=',Global_Str('PRINTER_TYPE')));
  2745. END_MACRO;
  2746.  
  2747. $MACRO EXTENS TRANS;
  2748. {******************************************************************************
  2749.                                                              MULTI-EDIT MACRO
  2750.  
  2751. NAME:  EXTENS
  2752.  
  2753. DESCRIPTION:  This is the filename extension specific setup menu.
  2754.  
  2755.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2756. ******************************************************************************}
  2757.  
  2758.     Def_Int(Jx,Jy,T_Reg_Exp_Stat);
  2759.     Def_Str(Tstr[60]);
  2760. {
  2761.         Set_Global_Str('T_Format',
  2762. '                                                                      R                                          '
  2763.         );
  2764. }
  2765.     T_Reg_Exp_Stat := Reg_Exp_Stat;
  2766.     Set_Global_Str('T_Format','');
  2767.     RM('USERIN^DB /F=MECONFIG.DB/Y=3/DPT=EXT.DB/PROTECT1=DEFAULT/PRE=EXT/LT=EXTENSION SETUP/NOALPHA=1/H=FE/GLO=EXT/CP=Input new extension: ');
  2768.     IF (Global_Int( '@DB_FILE_CHANGED' )) THEN
  2769. {If we made any changes to the extension setup, reload all current extension
  2770. globals}
  2771.         IF user_id = '' THEN
  2772.             tstr := CAPS(me_path + 'MECONFIG.DB');
  2773.         ELSE
  2774.             tstr := CAPS(me_path + user_id + '.USR\' + 'MECONFIG.DB');
  2775.         END;
  2776.         IF (switch_file( tstr )) THEN
  2777.             Last_Page_Break;
  2778.             Up;
  2779. {The following may look like a lot of stuff to do, but this provides a high
  2780. degree of confidence that we indeed are looking at the right place in
  2781. MECONFIG.DB}
  2782.             IF (Get_Line = '|12EXT.DB') THEN
  2783.                 Eol;
  2784.                 IF (Search_Fwd('%{@*@*@*@*START@*@*@*@*}||{|12}',0)) THEN
  2785.                     IF (Get_Line = '****START****') THEN
  2786.                         Down;
  2787.                         WHILE ((Not(At_Eof)) and (Cur_Char <> '|12')) DO
  2788.                             TStr := '.' + Parse_Str('EXT=',Get_Line);
  2789.                             IF (Global_Str(TStr) <> '') THEN
  2790.                                 Set_Global_Str(TStr,Get_Line);
  2791.                             END;
  2792.                             DOWN;
  2793.                         END;
  2794.                     END;
  2795.                 END;
  2796.             END;
  2797.         END;
  2798.  
  2799.     END;
  2800.     Reg_Exp_Stat := T_Reg_Exp_Stat;
  2801.     Set_Global_Str('T_Format','');
  2802. END_MACRO;
  2803.  
  2804. $MACRO LANG_MENU TRANS;
  2805. {******************************************************************************
  2806.                                                              MULTI-EDIT MACRO
  2807.  
  2808. Name:  LANG_MENU
  2809.  
  2810. Description:  Menu of language types for extension setup
  2811.  
  2812.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2813. ******************************************************************************}
  2814.  
  2815.     RM('USERIN^DB /PRE=LANG/F=MECONFIG.DB/DPT=LANGUAGE.DB/NC=1/NE=1/LO=1/U=1/TT=1/H=FE_LANGUAGE/GLO=@LANG/MACRO=SETUP^LANG_WARNING');
  2816. END_MACRO;
  2817.  
  2818. $MACRO PGM_MENU TRANS;
  2819. {******************************************************************************
  2820.                                                              MULTI-EDIT MACRO
  2821.  
  2822. Name:  PGM_MENU
  2823.  
  2824. Description:  Menu of compiler/program types for extension setup
  2825.  
  2826.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2827. ******************************************************************************}
  2828.  
  2829.     RM('USERIN^DB /F=MECONFIG.DB/DPT=PGM.DB/PRE=PT/GLO=PGM/NE=1/NC=1/LO=1/U=1/LT=COMPILER////PROGRAM/H=FE_PROGRAM/MACRO=SETUP^PGM_WARNING');
  2830. END_MACRO;
  2831.  
  2832. $MACRO PGM_DB TRANS;
  2833. {******************************************************************************
  2834.                                                              MULTI-EDIT MACRO
  2835.  
  2836. Name:  PGM_DB
  2837.  
  2838. Description:  Menu of program/compiler interfaces for the selected extension
  2839.                             This macro is run by DATA_IN
  2840.  
  2841. Parameters:
  2842.                             /PRE=        Prefix of the ISTR global.
  2843.  
  2844.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2845. ******************************************************************************}
  2846.  
  2847.     Def_Str( glob_name[20] );
  2848.     glob_name := parse_str('/PRE=', mparm_str ) + 'ISTR_1';
  2849.     RM('USERIN^DB /PRE=PGM/HPT=DEFAULT.PGM/F=MECONFIG.DB/DPT=' + global_str( glob_name ) +
  2850.     '.PGM/LT=COMPILER////PROGRAM SETUP/NOALPHA=1/H=FE_PROGRAM');
  2851. END_MACRO;
  2852.  
  2853. $MACRO PGM_WARNING TRANS;
  2854. {******************************************************************************
  2855.                                                              MULTI-EDIT MACRO
  2856.  
  2857. Name:  PGM_WARNING
  2858.  
  2859. Description:  Warns user that he cannot just arbitrarily add program types
  2860.                             without having support for them.
  2861.  
  2862.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2863. ******************************************************************************}
  2864.  
  2865.     IF (Parse_Int('/P=',MParm_Str)) THEN
  2866.         RM('MEERROR^MessageBox /T=WARNING/B=1/M=If you added any new program types, be sure that the macro CMPERROR in the macro file LANGUAGE.SRC has code to support it.');
  2867.     END;
  2868. END_MACRO;
  2869.  
  2870. $MACRO LANG_WARNING TRANS;
  2871. {******************************************************************************
  2872.                                                              MULTI-EDIT MACRO
  2873.  
  2874. Name:  LANG_WARNING
  2875.  
  2876. Description:  Warns user that he cannot just arbitrarily add language types
  2877.                             without having support for them.
  2878.  
  2879.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2880. ******************************************************************************}
  2881.  
  2882.     IF (Parse_Int('/P=',MParm_Str)) THEN
  2883.         RM('MEERROR^MessageBox /T=WARNING/B=1/M=If you added any new language types, be sure that you have the appropriate support macros.');
  2884.     END;
  2885. END_MACRO;
  2886.  
  2887. $MACRO EXT_FORMAT TRANS;
  2888. {******************************************************************************
  2889.                                                              MULTI-EDIT MACRO
  2890.  
  2891. Name:  EXT_FORMAT
  2892.  
  2893. Description:  Allows creation and/or editing of extension specific format lines.
  2894.  
  2895.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2896. ******************************************************************************}
  2897.  
  2898.     Def_Int(Temp_Integer,T_Message_Row,Null);
  2899.     Temp_Integer := Cur_Window;
  2900. {The format line editing macro "borrows" the line the cursor is on from the
  2901. current window.  We will make up a special window for this.}
  2902.     Switch_Window(Window_Count);
  2903.     Create_Window;
  2904.     Size_Window(1,9,78,11);
  2905.     File_Name := 'FORMAT-LINE';
  2906.     Put_Box(1,9,80,12,0,m_b_Color,'',True);
  2907.     Format_Line := Global_Str('T_Format');
  2908.     IF (Format_Line = '') THEN
  2909.         Format_Line :=
  2910. '                                                                      R                                          ';
  2911.     END;
  2912.     Refresh := True;
  2913.     Redraw;
  2914.     Write('Editing format line.  <Enter> or <Esc> to quit.', win_x1 + 2, win_y2, 0, b_color);
  2915.     T_Message_Row := Message_Row;
  2916.     Message_Row := 0;
  2917.     RM( 'meutil1^Edformat');
  2918.     IF (Format_Stat) THEN
  2919.         Set_Global_Str('T_Format',Format_Line);
  2920.     ELSE
  2921.         Set_Global_Str('T_Format','');
  2922.     END;
  2923.     Refresh := False;
  2924.     Delete_Window;
  2925.     Switch_Window(Temp_Integer);
  2926.     Kill_Box;
  2927.     Message_Row := T_Message_Row;
  2928.     Make_Message('');
  2929.     Return_Str := 'Edit format line';
  2930. END_MACRO;
  2931.  
  2932. $MACRO TGLVID TRANS;
  2933. {******************************************************************************
  2934.                                                              MULTI-EDIT MACRO
  2935.  
  2936. Name:  TGLVID
  2937.  
  2938. Description:  Toggles between 80X25 and 80X43 or 80X50 depending on the video
  2939. card.
  2940.  
  2941.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2942. ******************************************************************************}
  2943.         Def_Int(Old_Mode);         {The video mode before the toggle}
  2944.  
  2945.     Refresh := False;
  2946.     Old_Mode := Video_Mode;
  2947.     Toggle_Video;
  2948.     RM('SETSCRN');
  2949.  
  2950.     REFRESH := TRUE;
  2951.     NEW_SCREEN;
  2952.     Mou_Set_Limits( 1, 1, Screen_Width, Screen_Length );
  2953.  
  2954. END_MACRO;
  2955.  
  2956.  
  2957. $MACRO KEYCODE FROM ALL TRANS;
  2958. {******************************************************************************
  2959.                                                                 MULTI_EDIT MACRO
  2960.  
  2961. Name:  KEYCODE
  2962.  
  2963. Description:  The macro prompts for a key press and then returns the name and
  2964.     the main and extended codes for the key.
  2965.  
  2966.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2967. ******************************************************************************}
  2968.     Make_Message('Type the desired key.');
  2969.     READ_KEY;
  2970.     RM('MAKEKEY /K1='+Str(key1)+'/K2='+Str(key2));
  2971.     Make_Message(Return_Str + ' Keycode = '+Str(key1)+', Extended code = '+Str(key2));
  2972. END_MACRO;
  2973.  
  2974. $MACRO MAKEKEY FROM ALL TRANS;
  2975. {******************************************************************************
  2976.                                                                 MULTI_EDIT MACRO
  2977.  
  2978. Name:  MAKEKEY
  2979.  
  2980. Description:  Takes two integer keycode parameters and returns the name of the
  2981.     keycode in RETURN_STR.  See KEYCODE (above) for example.
  2982.  
  2983. Parameters:
  2984.                             /K1=    Primary scan code.
  2985.                             /K2=    Extended scan code.
  2986.  
  2987. Returns:
  2988.                             Return_Str contains the key name
  2989.  
  2990.                              (C) Copyright 1989 by American Cybernetics, Inc.
  2991. ******************************************************************************}
  2992.  
  2993.         Def_Int( what1, what0 );
  2994.  
  2995.         What0 := Parse_Int('/K1=', MParm_Str);
  2996.         What1 := Parse_Int('/K2=', MParm_Str);
  2997.         Return_Str := '';
  2998.         If (What0 = 0) and (What1 = 0) then
  2999.             Goto exit;
  3000.         END;
  3001.         Return_Str := 'Alt ';
  3002.         If What0 =  0 THEN
  3003.             If (What1 >= 59) and (What1 <= 68) THEN
  3004.                 Return_Str := Str(What1 - 58);
  3005.                 Return_Str := 'F'+Return_Str;
  3006.                 Goto Exit2;
  3007.             end;
  3008.             If (What1 >= 84) and (What1 <= 93) THEN
  3009.                 Return_Str := Str(What1 - 83);
  3010.                 Return_Str := 'ShftF'+Return_Str;
  3011.                 Goto Exit2;
  3012.             end;
  3013.             If (What1 >= 94) and (What1 <= 103) THEN
  3014.                 Return_Str := Str(What1 - 93);
  3015.                 Return_Str := 'CtrlF'+Return_Str;
  3016.                 Goto Exit2;
  3017.             end;
  3018.             If (What1 >= 104) and (What1 <= 113) THEN
  3019.                 Return_Str := Str(What1 - 103);
  3020.                 Return_Str := 'AltF'+Return_Str;
  3021.                 Goto Exit2;
  3022.             end;
  3023.             Return_Str := '';
  3024.  
  3025.             Return_Str := Parse_Str('/'+Str(What1)+'=',
  3026. '/129=Alt0/130=Alt-/131=Alt=/16=AltQ/17=AltW/18=AltE/19=AltR/20=AltT/21=AltY/40=Alt''/39=Alt;'+
  3027. '/22=AltU/23=AltI/24=AltO/25=AltP/30=AltA/31=AltS/32=AltD/33=AltF/34=AltG');
  3028.             If Return_Str = '' THEN
  3029.                 Return_Str  :=  Parse_Str('/'+Str(What1)+'=',
  3030. '/35=AltH/36=AltJ/37=AltK/38=AltL/44=AltZ/45=AltX/46=AltC/47=AltV/48=AltB'+
  3031. '/49=AltN/50=AltM/75=LF/77=RT/72=UP/80=DN/71=HOME/79=END' +
  3032. '/15=ShftTAB/115=CtrlLF/116=CtrlRT/119=CtrlHOME/117=CtrlEND/132=CtrlPGUP/118=CtrlPGDN');
  3033.             END;
  3034.             If Return_Str = '' THEN
  3035.                 Return_Str  :=  Parse_Str('/'+Str(What1)+'=',
  3036. '/120=Alt1/121=Alt2/122=Alt3/123=Alt4/124=Alt5/125=Alt6/126=Alt7/127=Alt8/128=Alt9'+
  3037. '/82=INS/83=DEL/133=F11/134=F12/135=ShftF11/136=ShftF12/137=CtrlF11/138=CtrlF12'+
  3038. '/246=Btn2/240=MsUP/241=MsDN/243=MsRT/242=MsLF/250=MEVENT');
  3039.             END;
  3040.             If Return_Str = '' THEN
  3041.                 Return_Str  :=  Parse_Str('/'+Str(What1)+'=',
  3042. '/73=PGUP/81=PGDN/141=CtrlUP/145=CtrlDN/143=CtrlCNTR/1=AltESC/251=MEVENT2/252=MEVENT3'+
  3043. '/76=CNTR/41=Alt`/51=Alt</52=Alt>/53=Alt?/146=CtrlINS/147=CtrlDEL/144=CtrlGREY+/142=CtrlGREY-' +
  3044. '/139=AltF11/140=AltF12/244=Btn0/245=Btn1/150=CtrlGREY*/55=AltGREY*'
  3045. );
  3046.  
  3047.             END;
  3048.             If Return_Str = '' THEN
  3049.                 Return_Str  :=  Parse_Str('/'+Str(What1)+'=',
  3050. '/74=AltGREY-/78=AltGREY+/166=AltGREYENTER/148=CtrlTAB/165=AltTAB/14=AltBS/28=AltENTER' +
  3051. '/26=Alt[/27=Alt]/3=Ctrl@/238=ScrollLockOn/239=ScrollLockOff/43=Alt\/162=AltIns/163=AltDel/151=AltHOME'
  3052. + '/159=AltEND/153=AltPgUp/161=AltPgDn/152=AltUP/160=AltDN/155=AltLF/157=AltRT'
  3053. );
  3054.  
  3055.             END;
  3056.  
  3057.  
  3058.             if (what1 = 164) then
  3059.                 return_str := 'AltGREY/';
  3060.             end;
  3061.             if (what1 = 149) then
  3062.                 return_str := 'CtrlGREY/';
  3063.             end;
  3064.  
  3065.             Goto Exit2;
  3066.         END;
  3067.  
  3068.             Return_Str := '';
  3069.     Return_Str := Parse_Str('/'+Str(What0)+','+Str(What1)+'=',
  3070. '/13,28=ENTER/13,224=GreyENTER/13,50=CtrlM/10,28=CtrlENTER/10,36=CtrlJ/27,1=ESC/27,26=Ctrl[/8,14=BS/8,35=CtrlH'+
  3071. '/10,224=CtrlGreyENTER/9,15=TAB/9,23=CtrlI/55,8=7/55,71=ShftHOME/56,9=8/56,72=ShftUP/57,10=9/57,73=ShftPGUP');
  3072.             If Return_Str = '' THEN
  3073.                 Return_Str  :=  Parse_Str('/'+Str(What0)+','+Str(What1)+'=',
  3074. '/45,12=-/45,74=GREY-/42,9=*/42,55=GREY*/52,5=4/52,75=ShftLF/53,6=5/53,76=ShftCNTR'+
  3075. '/54,7=6/54,77=ShftRT/43,13=+/43,78=GREY+/49,2=1/49,79=ShftEND/50,3=2/50,80=ShftDN'+
  3076. '/51,4=3/51,81=ShftPGDN/48,11=0/48,82=ShftINS/46,52=./46,83=ShftDEL');
  3077.             END;
  3078.  
  3079.             if (what0 = 47) and (what1 = 224) then
  3080.                 return_str := 'GREY/';
  3081.             end;
  3082.  
  3083.             If Return_Str = '' THEN
  3084.                 Return_Str  :=  Parse_Str('/'+Str(What0)+'=',
  3085. '/127=CtrlBS');
  3086.             END;
  3087.             If Return_Str = '' THEN
  3088. IF (What0 >= 1) and (What0 <= 31) THEN
  3089.         Return_Str := 'Ctrl'+Char(What0 + 64);
  3090. Else
  3091.                 Return_Str := char(What0);
  3092.                 goto exit;
  3093.         end;
  3094.             END;
  3095.  
  3096. Exit2:
  3097.         Return_Str := '<' + Return_Str + '>';
  3098. EXIT:
  3099. END_MACRO;
  3100.  
  3101. {**** THESE 2 MACROS ARE NECCESSARY IF WE EMPLOY OUR KEYSTROKE ASSIGNMENTS
  3102.             "ON THE FLY" TECHNIQUE}
  3103. $MACRO MAKE_SCAN_CODES FROM ALL TRANS;
  3104. {******************************************************************************
  3105.                                                                 MULTI_EDIT MACRO
  3106.  
  3107. Name:  MAKE_SCAN_CODES
  3108.  
  3109. Description:  Takes a valid keycode (like <CtrlF2>) and returns the proper
  3110.                             scan codes.  Essentially the opposite of MAKEKEY.
  3111.  
  3112. Parameters:
  3113.                             Return_Str should contain the key name
  3114.  
  3115. Returns:
  3116.                             If successful, Return_Str contains:
  3117.                                 /K1=    Primary scan code.
  3118.                                 /K2=    Extended scan code.
  3119.                             Otherwise, Return_Str = ''.
  3120.                             Also, Return_Int contains the combined scan codes
  3121.                             in a 2 byte value.  Otherwise, Return_Int = 0.
  3122.  
  3123.                              (C) Copyright 1989 by American Cybernetics, Inc.
  3124. ******************************************************************************}
  3125.  
  3126.     Def_Int(jx,Jy);
  3127.     Def_Str(KName[20],TStr);
  3128.  
  3129.     KNAME := Return_Str;
  3130.     Return_Str := '';
  3131.     Return_Int := 0;
  3132.     If (Kname = '') then
  3133.         Goto exit;
  3134.     END;
  3135. {Strip <> if present}
  3136.     IF (Svl(KName) > 2) THEN
  3137.         IF (Str_Char(KName,1) <> '<') THEN
  3138.             Goto EXIT;
  3139.         END;
  3140.         IF (Str_Char(KName,Svl(KName)) <> '>') THEN
  3141.             Goto EXIT;
  3142.         END;
  3143.         Kname := Caps(Copy(Kname,2,Svl(KName) - 2));
  3144.     END;
  3145.  
  3146. {If it is a function key...}
  3147.     IF (Xpos('F',Kname,1)) THEN
  3148.         TStr := Kname;
  3149.         IF (XPos('SHFT',TStr,1) = 1) THEN
  3150.             Tstr := Copy(Tstr,5,20);
  3151.             Jx := 25;
  3152.         ELSIF (XPos('CTRL',tstr,1) = 1) THEN
  3153.             Tstr := Copy(Tstr,5,20);
  3154.             Jx := 35;
  3155.         ELSIF (XPos('ALT',tstr,1) = 1) THEN
  3156.             Tstr := Copy(Tstr,4,20);
  3157.             Jx := 45;
  3158.         ELSE
  3159.             Jx := 0;
  3160.         END;
  3161.         IF (Str_Char(Tstr,1) <> 'F') THEN
  3162.             Goto NOT_FKEY;
  3163.         END;
  3164.         Tstr := Copy(Tstr,2,20);
  3165.         IF ((Tstr = '') or (Svl(Tstr) > 2)) THEN
  3166.             Goto NOT_FKEY;
  3167.         END;
  3168.         IF (Val(Jy,Tstr) or (Jy < 1) or (Jy > 10)) THEN
  3169.             Goto NOT_FKEY;
  3170.         END;
  3171.         Return_Str := Str(Jy + 58 + Jx);
  3172.         IF (Jx) THEN
  3173.             Jx := Jx - 15;
  3174.         END;
  3175.         Set_Global_Int('!FKEY@',Jy + Jx);
  3176.         Goto EXIT2;
  3177.     END;
  3178.  
  3179. NOT_FKEY:
  3180.     Set_Global_Int('!FKEY@',0);
  3181.  
  3182.     Return_Str := Parse_Str('' + Kname + '≡',
  3183. 'ALT0≡129ALT-≡130ALT=≡131ALTQ≡16ALTW≡17ALTE≡18ALTR≡19ALTT≡20ALTY≡21' +
  3184. 'ALT''≡40ALT;≡39ALTU≡22ALTI≡23ALTO≡24ALTP≡25ALTA≡30ALTS≡31ALTD≡32' +
  3185. 'ALTF≡33ALTG≡34');
  3186.     IF (Return_Str <> '') THEN
  3187.         Goto EXIT2;
  3188.     END;
  3189.  
  3190.     Return_Str := Parse_Str('' + Kname + '≡',
  3191. 'ALTH≡35ALTJ≡36ALTK≡37ALTL≡38ALTZ≡44ALTX≡45ALTC≡46ALTV≡47ALTB≡48' +
  3192. 'ALTN≡49ALTM≡50LF≡75RT≡77UP≡72DN≡80HOME≡71END≡79SHFTTAB≡15' +
  3193. 'CTRLLF≡115CTRLRT≡116CTRLHOME≡119CTRLEND≡117CTRLPGUP≡132CTRLPGDN≡118');
  3194.     IF (Return_Str <> '') THEN
  3195.         Goto EXIT2;
  3196.     END;
  3197.  
  3198.     Return_Str := Parse_Str('' + Kname + '≡',
  3199. 'ALT1≡120ALT2≡121ALT3≡122ALT4≡123ALT5≡124ALT6≡125ALT7≡126ALT8≡127' +
  3200. 'ALT9≡128INS≡82DEL≡83F11≡133F12≡134SHFTF11≡135SHFTF12≡136CTRLF11≡137' +
  3201. 'CTRLF12≡138BTN2≡246MSUP≡240MSDN≡241MSRT≡243MSLF≡242MEVENT≡250');
  3202.     IF (Return_Str <> '') THEN
  3203.         Goto EXIT2;
  3204.     END;
  3205.  
  3206.     Return_Str := Parse_Str('' + Kname + '≡',
  3207. 'PGUP≡73PGDN≡81CTRLUP≡141CTRLDN≡145CTRLCNTR≡143ALTESC≡1MEVENT2≡251' +
  3208. 'MEVENT3≡252CNTR≡76ALT`≡41ALT<≡51ALT>≡52ALT?≡53CTRLINS≡146' +
  3209. 'CTRLDEL≡147CTRLGREY+≡144CTRLGREY-≡142ALTF11≡139ALTF12≡140BTN0≡244' +
  3210. 'BTN1≡245CTRLGREY*≡150ALTGREY*≡55');
  3211.     IF (Return_Str <> '') THEN
  3212.         Goto EXIT2;
  3213.     END;
  3214.  
  3215.     Return_Str := Parse_Str('' + Kname + '≡',
  3216. 'ALTGREY-≡74ALTGREY+≡78ALTGREYENTER≡166CTRLTAB≡148ALTTAB≡165ALTBS≡14' +
  3217. 'ALTENTER≡28ALT[≡26ALT]≡27CTRL@≡3SCROLLLOCKON≡238SCROLLLOCKOFF≡239' +
  3218. 'ALT\≡43ALTINS≡162ALTDEL≡163ALTHOME≡151ALTEND≡159ALTPGUP≡153' +
  3219. 'ALTPGDN≡161ALTUP≡152ALTDN≡160ALTLF≡155ALTRT≡157ALTGREY/≡164' +
  3220. 'CTRLGREY/≡149');
  3221.     IF (Return_Str <> '') THEN
  3222.         Goto EXIT2;
  3223.     END;
  3224.  
  3225.     Return_Str := Parse_Str('' + Kname + '≡',
  3226. 'ENTER≡13/K2=28GREYENTER≡13/K2=224CTRLM≡13/K2=50CTRLENTER≡10/K2=28' +
  3227. 'CTRLJ≡10/K2=36ESC≡27/K2=1CTRL[≡27/K2=26BS≡8/K2=14CTRLH≡8/K2=35' +
  3228. 'CTRLGREYENTER≡10/K2=224TAB≡9/K2=15CTRLI≡9/K2=237≡55/K2=8' +
  3229. 'SHFTHOME≡55/K2=718≡56/K2=9SHFTUP≡56/K2=729≡57/K2=10SHFTPGUP≡57/K2=73');
  3230.     IF (Return_Str <> '') THEN
  3231.         Return_Str := '/K1=' + Return_Str;
  3232.         Goto EXIT;
  3233.     END;
  3234.  
  3235.     Return_Str := Parse_Str('' + Kname + '≡',
  3236. '-≡45/K2=12GREY-≡45/K2=74*≡42/K2=9GREY*≡42/K2=554≡52/K2=5' +
  3237. 'SHFTLF≡52/K2=755≡53/K2=6SHFTCNTR≡53/K2=766≡54/K2=7SHFTRT≡54/K2=77' +
  3238. '+≡43/K2=13GREY+≡43/K2=781≡49/K2=2SHFTEND≡49/K2=792≡50/K2=3' +
  3239. 'SHFTDN≡50/K2=803≡51/K2=4SHFTPGDN≡51/K2=810≡48/K2=11SHFTINS≡48/K2=82' +
  3240. '.≡46/K2=52SHFTDEL≡46/K2=83GREY/≡47/K2=244CTRLBS≡127/K2=14');
  3241.     IF (Return_Str <> '') THEN
  3242.         Return_Str := '/K1=' + Return_Str;
  3243.         Goto EXIT;
  3244.     END;
  3245.  
  3246.     IF ((XPos('CTRL',kname,1) = 1) and (Svl(Kname) = 5)) THEN
  3247.         Jx := Ascii(Str_Char(Kname,5));
  3248.         IF ((Jx > 63) and (Jx < 96)) THEN
  3249.             TStr :=
  3250. '|3|30|48|46|32|18|33|34|35|23|36|37|38|50|49|24|25|16|19|31|20|22|47|17|45' +
  3251. '|21|44|26|43|27|7|12';
  3252.             Return_Str := '/K1=' + Str(Ascii(Kname)) +
  3253.                                         '/K2=' + Str(Ascii(Str_Char(Tstr,Jx - 63)));
  3254.             Goto EXIT;
  3255.         END;
  3256.  
  3257.     END;
  3258.  
  3259.     IF (Svl(Kname) = 1) THEN
  3260. {Alphanumeric}
  3261.         Jx := Ascii(Kname);
  3262.         IF ((Jx > 31) and (Jx < 127)) THEN
  3263.             TStr :=
  3264. '|57|2|40|4|5|6|8|40|10|11|9|13|51|12|52|53|11|2|3|4|5|6|7|8|9|10|39|39|51' +
  3265. '|13|52|53|3|30|48|46|32|18|33|34|35|23|36|37|38|50|49|24|25|16|19|31|20|22' +
  3266. '|47|17|45|21|44|26|43|27|7|12|41|30|48|46|32|18|33|34|35|23|36|37|38|50|49' +
  3267. '|24|25|16|19|31|20|22|47|17|45|21|44|26|43|27|41';
  3268.             Return_Str := '/K1=' + Str(Ascii(Kname)) +
  3269.                                         '/K2=' + Str(Ascii(Str_Char(Tstr,Jx - 31)));
  3270.             Goto EXIT;
  3271.         END;
  3272.     END;
  3273.  
  3274. EXIT2:
  3275.     Return_Str := '/K1=0/K2='+ Return_Str;
  3276.  
  3277. EXIT:
  3278.     IF (Return_Str <> '') THEN
  3279.         Return_Int := (Parse_Int('/K2=',Return_Str) shl 8) or
  3280.             Parse_Int('/K1=',Return_Str);
  3281.     END;
  3282. END_MACRO;
  3283.  
  3284. $MACRO ASSIGN_CMD FROM ALL TRANS;
  3285. {******************************************************************************
  3286.                                                                 MULTI_EDIT MACRO
  3287.  
  3288. Name:  ASSIGN_CMD
  3289.  
  3290. Description:  Takes a valid command name (like DEL_CHAR) and assigns a valid
  3291.                             key value to it.
  3292.  
  3293. Parameters:
  3294.                             Return_Str should contain the command name
  3295.                             Return_Int should contain the 2 byte key value
  3296.  
  3297. Returns:
  3298.                             Return_Int = 1 if successful, 0 if not.
  3299.  
  3300.                              (C) Copyright 1989 by American Cybernetics, Inc.
  3301. ******************************************************************************}
  3302.     Def_Str(Cmd[20] := Caps(Parse_Str('/C=',MParm_Str)));
  3303.     Def_int(
  3304.                     C_Mode := Parse_Int('/M=',MParm_Str),
  3305.                     Key := Parse_Int('/K=',MParm_Str)
  3306.                     );
  3307.  
  3308.     Return_Int := 0;
  3309.     IF (Key < 1) THEN
  3310.         Goto EXIT;
  3311.     END;
  3312.     IF (Cmd = '') THEN
  3313.         Goto EXIT;
  3314.     END;
  3315.     IF (C_Mode < 0) THEN
  3316.         C_Mode := 0;
  3317.     END;
  3318.     Return_Int := 1;
  3319.  
  3320.     IF (Cmd = 'DEL_CHAR') THEN
  3321.         Cmd_to_Key(Key,DEL_CHAR,C_Mode);
  3322.     ELSIF (Cmd = 'BACK_SPACE') THEN
  3323.         Cmd_to_Key(Key,BACK_SPACE,C_Mode);
  3324.     ELSIF (Cmd = 'DEL_LINE') THEN
  3325.         Cmd_to_Key(Key,DEL_LINE,C_Mode);
  3326.     ELSIF (Cmd = 'UNDO') THEN
  3327.         Cmd_to_Key(Key,UNDO,C_Mode);
  3328.     ELSIF (Cmd = 'REDO') THEN
  3329.         Cmd_to_Key(Key,REDO,C_Mode);
  3330.     ELSIF (Cmd = 'LEFT') THEN
  3331.         Cmd_to_Key(Key,LEFT,C_Mode);
  3332.     ELSIF (Cmd = 'RIGHT') THEN
  3333.         Cmd_to_Key(Key,RIGHT,C_Mode);
  3334.     ELSIF (Cmd = 'UP') THEN
  3335.         Cmd_to_Key(Key,UP,C_Mode);
  3336.     ELSIF (Cmd = 'DOWN') THEN
  3337.         Cmd_to_Key(Key,DOWN,C_Mode);
  3338.     ELSIF (Cmd = 'PAGE_UP') THEN
  3339.         Cmd_to_Key(Key,PAGE_UP,C_Mode);
  3340.     ELSIF (Cmd = 'PAGE_DOWN') THEN
  3341.         Cmd_to_Key(Key,PAGE_DOWN,C_Mode);
  3342.     ELSIF (Cmd = 'TOF') THEN
  3343.         Cmd_to_Key(Key,TOF,C_Mode);
  3344.     ELSIF (Cmd = 'EOF') THEN
  3345.         Cmd_to_Key(Key,EOF,C_Mode);
  3346.     ELSIF (Cmd = 'NEXT_PAGE_BREAK') THEN
  3347.         Cmd_to_Key(Key,NEXT_PAGE_BREAK,C_Mode);
  3348.     ELSIF (Cmd = 'LAST_PAGE_BREAK') THEN
  3349.         Cmd_to_Key(Key,LAST_PAGE_BREAK,C_Mode);
  3350.     ELSIF (Cmd = 'WORD_LEFT') THEN
  3351.         Cmd_to_Key(Key,WORD_LEFT,C_Mode);
  3352.     ELSIF (Cmd = 'WORD_RIGHT') THEN
  3353.         Cmd_to_Key(Key,WORD_RIGHT,C_Mode);
  3354.     ELSIF (Cmd = 'TAB_RIGHT') THEN
  3355.         Cmd_to_Key(Key,TAB_RIGHT,C_Mode);
  3356.     ELSIF (Cmd = 'TAB_LEFT') THEN
  3357.         Cmd_to_Key(Key,TAB_LEFT,C_Mode);
  3358.     ELSIF (Cmd = 'INDENT') THEN
  3359.         Cmd_to_Key(Key,INDENT,C_Mode);
  3360.     ELSIF (Cmd = 'UNDENT') THEN
  3361.         Cmd_to_Key(Key,UNDENT,C_Mode);
  3362.     ELSIF (Cmd = 'KEY_RECORD') THEN
  3363.         Cmd_to_Key(Key,KEY_RECORD,C_Mode);
  3364.     ELSE
  3365.         Return_Int := 0;
  3366.     END;
  3367. EXIT:
  3368. END_MACRO;
  3369.  
  3370. {$MACRO CMD_VAL FROM ALL TRANS;
  3371. {******************************************************************************
  3372.                                                                 MULTI_EDIT MACRO
  3373.  
  3374. Name:  CMD_VAL
  3375.  
  3376. Description:  Takes a valid command name (like DEL_CHAR) and returns the proper
  3377.                             Numeric value.
  3378.  
  3379. Parameters:
  3380.                             Return_Str should contain the command name
  3381.  
  3382. Returns:
  3383.                             If successful, Return_Int contains the value, otherwise
  3384.                             Return_Int = 0.
  3385.  
  3386.                              (C) Copyright 1989 by American Cybernetics, Inc.
  3387. ******************************************************************************}
  3388.         Return_Int := Parse_Int('/' + Caps(Return_Str) + '=',
  3389. '/DEL_CHAR=24/BACK_SPACE=25/DEL_LINE=26/UNDO=27/REDO=80/LEFT=1/RIGHT=2/UP=3' +
  3390. '/DOWN=4/PAGE_UP=7/PAGE_DOWN=8/TOF=9/EOF=10/NEXT_PAGE_BREAK=11' +
  3391. '/LAST_PAGE_BREAK=12/WORD_LEFT=13/WORD_RIGHT=14/TAB_RIGHT=20/TAB_LEFT=21' +
  3392. '/INDENT=22/UNDENT=23/KEY_RECORD=67');
  3393. END_MACRO;
  3394. }
  3395.  
  3396. $MACRO BUILDKEY FROM EDIT TRANS;
  3397. {******************************************************************************
  3398.                                                                 MULTI-EDIT MACRO
  3399.  
  3400. Name:        BUILDKEY
  3401.  
  3402. Description:  This macro converts a keystroke macro into a KEY_IN macro
  3403.                             statement and optionally creates an entire macro from it.
  3404.  
  3405.                              (C) Copyright 1989 by American Cybernetics, Inc.
  3406. ******************************************************************************}
  3407.  
  3408.     Def_Int(JX,JY,JJ,T_Insert_Mode);
  3409.     Def_Str(TStr,Macro_Name);
  3410.  
  3411.     T_Insert_Mode := Insert_Mode;
  3412.     Put_Box(16,3,65,8,0,m_b_color,'CREATE KEYSTROKE MACRO SOURCE',True);
  3413.     RM('USERIN^XMENU /X=28/Y=5/M=Complete macro(KM)Key_In only()');
  3414.     jj := return_int;
  3415.     If JJ < 1 THEN
  3416.         Kill_Box;
  3417.         GOTO Exit;
  3418.     END;
  3419.     Write('  Multi-Edit mode =                  ',17,5,0,m_s_Color);
  3420.     RM('USERIN^XMENU /X=37/Y=5/M=EDIT(IN)DOS_SHELL()TERM()ALL()');
  3421.     jx := return_int;
  3422.     If JX < 1 THEN
  3423.         Kill_Box;
  3424.         GOTO Exit;
  3425.     END;
  3426.     Macro_Name := '';
  3427.     IF (JJ = 1) THEN
  3428. MACRO_NAME_AGAIN:
  3429.         draw_char(32,46,5,m_t_color,14);
  3430.         return_str := '';
  3431.         RM('USERSTR /P=      Enter macro name: /W=8/X=17/Y=5/H=KM');
  3432.         IF return_int = 0 THEN
  3433.             GOTO EXIT;
  3434.         END;
  3435.         macro_name := return_str;
  3436.         IF (Macro_Name = '') THEN
  3437.             RM('MEERROR^Beeps /C=1');
  3438.             Goto MACRO_NAME_AGAIN;
  3439.         END;
  3440.     END;
  3441.  
  3442.     Macro_Name := Caps(Macro_Name);
  3443.     Write('          Press the desired key...        ',20,5,0,m_s_Color);
  3444.     READ_KEY;
  3445.     Kill_Box;
  3446.     Insert_Mode := True;
  3447.  
  3448.     Push_Undo;
  3449.     If JJ = 1 THEN
  3450.         Create_Window;
  3451.         File_Name := Macro_Name + '.SRC';
  3452.         RM('EXTSETUP');
  3453.  
  3454.         RM('keycode^MAKEKEY /K1='+Str(key1)+'/K2='+Str(key2));
  3455.         TStr := Return_Str;
  3456.         If Copy(TStr,1,1) = '<' Then
  3457.             TStr := Str_Del(Tstr,1,1);
  3458.         END;
  3459.         IF Copy(TStr,Length(TStr),1) = '>' THEN
  3460.             Tstr := Str_Del(TStr,Length(TStr),1);
  3461.         END;
  3462.  
  3463. {
  3464.         RM('keycode^MAKEKEY /K1='+Str(key1)+'/K2='+Str(key2));
  3465.         TStr := Return_Str;
  3466. }
  3467.         TEXT('$MACRO ' + MACRO_NAME + ' TO ' + RETURN_STR + ' FROM ' +
  3468.         remove_space(copy('EDIT     DOS_SHELLTERM     ALL',((jx-1)*9) + 1,9)));
  3469.  
  3470.         CR;
  3471.         CR;
  3472.         TEXT('END_MACRO;');
  3473.         UP;
  3474.         Goto_Col(3);
  3475.     END;
  3476.     Text('Key_In(');
  3477.     Jy := C_Col;
  3478.     Play_Key_Macro(key1,key2,MODE);
  3479.     While Check_Key DO
  3480.         IF (C_COL > 70) THEN
  3481.             CR;
  3482.             GOTO_COL(1);
  3483.         end;
  3484.         RM('keycode^MAKEKEY /K1='+Str(key1)+'/K2='+Str(key2));
  3485.         TStr := Return_Str;
  3486.         IF (XPos(TStr,'><()',1)) THEN
  3487.             Text('<' + TStr + '>');
  3488.         ELSE
  3489.             Text(Tstr);
  3490.         END;
  3491.     END;
  3492.     Text(');');
  3493.     Redraw;
  3494.  
  3495.     IF JJ = 1 THEN
  3496.         Tof;
  3497.         Make_Message('Invoke COMPILE to compile this keystroke macro.');
  3498.     END;
  3499.  
  3500.     POP_Undo;
  3501.  
  3502. EXIT:
  3503.     Insert_Mode := T_Insert_Mode;
  3504. END_MACRO;
  3505.  
  3506.  
  3507. {end of setup.src}
  3508.