home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-04 | 54.1 KB | 1,642 lines |
- $MACRO_FILE MEUTIL3;
- {******************************************************************************
- MULTI-EDIT MACRO FILE MEUTIL3
-
- MEMENUS - The main menu system
- FILEMENU - The file menu
- WINDMENU - The window operations menu
- BLCKMENU - The block operations menu
- CPMENU - The cut and paste buffer operations menu
- SRCHMENU - Search menu
- CASEMENU - The change case menu
- SORTMENU - The text sort menu
- TEXTMENU - The text menu
- CURSRMENU - The cursor menu
- USERSETTABS - Prompts the user for a new fixed tab spacing.
- LAYMENU - The layout menu
- MACMENU - The macro menu
- LOADMACRO - Prompts for a macro file to load
- LISTMACS - Creates a list of macros
- LISTGLOB - Creates a list of global variables
- MISCMENU - The "other" menu
- USER - The user menu
- PRINTSTR - Sends a string to the printer
- PRINT_FILE_BLOCK- Sends a file or marked block to the printer
- OPEN_CLOSE_FILE - Opens or closes a file or device
- PRINT - The Printing menu
- PRINT_CODE_MENU - The printer code selection menu
- NOTINC - Presents an "Option not included" message
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- $MACRO MEMENUS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: MEMENUS
-
- Description: The main menu.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_int( jx,y, count );
- set_global_int('MENU_LEVEL', 0);
- push_labels;
- jx := 1;
- y := menu_bar_row;
- IF y = 0 THEN
- y := 2;
- jx := 0;
- END;
- Create_Global_Str('0ISTR_1','/H=FL/M=FileMenu');
- Create_Global_Str('X0ISTR_1','File');
- Create_Global_Str('0ISTR_2','/H=WN/M=WindMenu');
- Create_Global_Str('X0ISTR_2','Window');
- Create_Global_Str('0ISTR_3','/H=BL/M=BlckMenu');
- Create_Global_Str('X0ISTR_3','Block');
- Create_Global_Str('0ISTR_4','/H=CURSMENU/M=CursrMenu');
- Create_Global_Str('X0ISTR_4','Cursor');
- Create_Global_Str('0ISTR_5','/H=SR/M=SrchMenu');
- Create_Global_Str('X0ISTR_5','Search');
- Create_Global_Str('0ISTR_6','/H=TEXTMENU/M=TextMenu');
- Create_Global_Str('X0ISTR_6','Text');
- Create_Global_Str('0ISTR_7','/H=LAYOUT/M=LayMenu');
- Create_Global_Str('X0ISTR_7','Layout');
- Create_Global_Str('0ISTR_8','/H=PR/M=Print');
- Create_Global_Str('X0ISTR_8','Print');
- Create_Global_Str('0ISTR_9','/H=MC/M=MacMenu');
- Create_Global_Str('X0ISTR_9','Macro');
- Create_Global_Str('0ISTR_10','/H=IN/S=2/M=Setup');
- Create_Global_Str('X0ISTR_10','Install');
- Create_Global_Str('0ISTR_11','/H=OTHER/M=MiscMenu');
- Create_Global_Str('X0ISTR_11','Other');
- Create_Global_Str('0ISTR_12','/H=QUIT/S=2/M=Exit');
- Create_Global_Str('X0ISTR_12','Quit');
- count := 12;
-
- RM('USERIN^TOPMENU /M=X0ISTR_/G=0ISTR_/#=' + str(count) + '/X=1/Y=' + str(y) +
- '/S=' + global_str('0ISTR_0')+ '/L=MAIN/B=' + str(jx));
-
- jx := 0;
- while jx < 11 do
- ++ jx;
- set_global_str('0ISTR_' + str(jx), '');
- set_global_str('X0ISTR_' + str(jx), '');
- end;
- update_status_line;
- draw_menu_bar;
- set_global_int('MENU_LEVEL', 0);
- pop_labels;
- END_MACRO;
-
- $MACRO FILEMENU;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: FILEMENU
-
- Description: The file menu.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20] );
-
- gstr := '!FM!_';
- Create_Global_Str(gstr+'1','/M=meutil1^LOADFILE /E=1');
- Create_Global_Str(gstr+'X1','Edit new file... ^' + global_str('!FM_KEY1'));
- Create_Global_Str(gstr+'2','/M=meutil1^LOADFILE');
- Create_Global_Str(gstr+'X2','Load file into current window... ^' + global_str('!FM_KEY2'));
- Create_Global_Str(gstr+'3','/M=meutil1^SAVEFILE /NP=1');
- Create_Global_Str(gstr+'X3','Save file in current window ^' + global_str('!FM_KEY3'));
- Create_Global_Str(gstr+'4','/M=meutil1^SAVEFILE');
- Create_Global_Str(gstr+'X4','save file As... ^' + global_str('!FM_KEY4'));
- Create_Global_Str(gstr+'5','/M=meutil1^FILESTAT');
- Create_Global_Str(gstr+'X5','Information about current file...^' + global_str('!FM_KEY5'));
- Create_Global_Str(gstr+'6','');
- Create_Global_Str(gstr+'X6','|254');
- Create_Global_Str(gstr+'7','/M=meutil1^SPLICE');
- Create_Global_Str(gstr+'X7','Merge file from disk... ^' + global_str('!FM_KEY7'));
- Create_Global_Str(gstr+'8','/M=meutil1^SAVEBLCK');
- IF block_stat <> 0 THEN
- Create_Global_Str(gstr+'X8','save Block to disk... ^' + global_str('!FM_KEY8'));
- ELSE
- Create_Global_Str(gstr+'X8','(save Block to disk... ^' + global_str('!FM_KEY8') + ')|254');
- END;
- Create_Global_Str(gstr+'9','');
- Create_Global_Str(gstr+'X9','|254');
- Create_Global_Str(gstr+'10','/S=2/M=DIRSHELL');
- Create_Global_Str(gstr+'X10','DOS directory shell ^' + global_str('!FM_KEY10'));
- Create_Global_Str(gstr+'11','/S=2/M=Exit');
- Create_Global_Str(gstr+'X11','eXit Multi-Edit ^' + global_str('!FM_KEY11'));
- do_xmenu:
- RM('USERIN^SUBMENU /H=FL/GCLR=1/#=11/M=' + gstr + 'X' + '/S=' +global_str(gstr+'0') +'/L=FILE/G=' + gstr + MParm_Str);
-
- END_MACRO;
-
- $MACRO WINDMENU;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: WINDMENU
-
- Description: The window menu.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20] );
- gstr := '!WNM!_';
- Create_Global_Str(gstr+'1','/S=2/M=WINDOW^WINOP /T=0');
- Create_Global_Str(gstr+'X1','Open ^' + global_str('!WM_KEY1'));
- Create_Global_Str(gstr+'2','/M=WINDOW^WINOP /T=1');
- Create_Global_Str(gstr+'X2','Close ^' + global_str('!WM_KEY2'));
-
- { {IF you want the old WINDOW MENU Create AND Delete then comment out
- the previous 4 lines and uncomment these lines }
- Create_Global_Str(gstr+'1','/S=2/M=WINDOW^WINOP /T=0');
- Create_Global_Str(gstr+'X1','Create ^' + global_str('!WM_KEY1'));
- Create_Global_Str(gstr+'2','/M=WINDOW^WINOP /T=1');
- Create_Global_Str(gstr+'X2','Delete ^' + global_str('!WM_KEY2'));
- }
- Create_Global_Str(gstr+'3','/S=2/M=WINDOW^WINOP /T=4');
- Create_Global_Str(gstr+'X3','Split ^' + global_str('!WM_KEY3'));
- Create_Global_Str(gstr+'4','/S=2/M=WINDOW^WINOP /T=3');
- Create_Global_Str(gstr+'X4','List... ^' + global_str('!WM_KEY4'));
- Create_Global_Str(gstr+'5','');
- Create_Global_Str(gstr+'X5','|254');
- Create_Global_Str(gstr+'6','/S=2/M=WINDOW^NEXTWIN');
- Create_Global_Str(gstr+'X6','Next ^' + global_str('!WM_KEY6'));
- Create_Global_Str(gstr+'7','/S=2/M=WINDOW^LASTWIN');
- Create_Global_Str(gstr+'X7','Previous ^' + global_str('!WM_KEY7'));
- Create_Global_Str(gstr+'8','/S=2/M=WINDOW^ADJACENT_WIN');
-
- RM('WINDOW^SCREEN_SHARE');
- IF (Return_Int) THEN
- Create_Global_Str(gstr+'X8','Adjacent ^' + global_str('!WM_KEY8'));
- ELSE
- Create_Global_Str(gstr+'X8','(Adjacent ^' + global_str('!WM_KEY8') + ')|254');
- end;
-
- Create_Global_Str(gstr+'9','');
- Create_Global_Str(gstr+'X9','|254');
- Create_Global_Str(gstr+'10','/S=2/M=WINDOW^WINOP /T=2');
- Create_Global_Str(gstr+'X10','Hide ^' + global_str('!WM_KEY10'));
- Create_Global_Str(gstr+'11','/S=2/M=WINDOW^WINOP /T=5');
- Create_Global_Str(gstr+'X11','Modify size ^' + global_str('!WM_KEY11'));
- Create_Global_Str(gstr+'12','/S=2/M=WINDOW^WINOP /T=8');
- Create_Global_Str(gstr+'X12','Zoom ^' + global_str('!WM_KEY12'));
- Create_Global_Str(gstr+'13','');
- Create_Global_Str(gstr+'X13','|254');
- Create_Global_Str(gstr+'14','/M=WINDOW^WINOP /T=6');
- Create_Global_Str(gstr+'X14','linK... ^' + global_str('!WM_KEY14'));
- Create_Global_Str(gstr+'15','/S=2/M=WINDOW^WINOP /T=7');
- IF (link_stat > 0) THEN
- Create_Global_Str(gstr+'X15','Unlink ^' + global_str('!WM_KEY15'));
- ELSE
- Create_Global_Str(gstr+'X15','(Unlink ^' + global_str('!WM_KEY15') + ')|254');
- END;
- do_xmenu:
- RM('USERIN^SUBMENU /H=WN/GCLR=1/#=15/M=' + gstr + 'X' + '/S=' +global_str(gstr+'0') +'/L=WINDOW/G=' + gstr + MParm_Str);
- END_MACRO;
-
-
- $MACRO BLCKMENU;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: BLCKMENU
-
- Description: The block menu.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20], bsstr1[1], bsstr2[2] );
- def_int( count );
- gstr := '!BLM!_';
- IF block_stat = 0 THEN
- bsstr1 := '(';
- bsstr2 := ')|254';
- END;
- Create_Global_Str(gstr+'1','/S=2/M=meutil2^BlockOp /BT=0');
- Create_Global_Str(gstr+'X1',bsstr1 + 'Copy block ^' + global_str('!BM_KEY1') + bsstr2);
- Create_Global_Str(gstr+'2','/S=2/M=meutil2^BlockOp /BT=1');
- Create_Global_Str(gstr+'X2',bsstr1 + 'Move block ^' + global_str('!BM_KEY2') + bsstr2);
- Create_Global_Str(gstr+'3','/S=2/M=meutil2^BlockOp /BT=2');
- Create_Global_Str(gstr+'X3',bsstr1 + 'Delete block ^' + global_str('!BM_KEY3') + bsstr2);
- Create_Global_Str(gstr+'4','');
- Create_Global_Str(gstr+'X4','|254');
- Create_Global_Str(gstr+'5','/M=CPmenu /Y=' + str(parse_int('/Y=', mparm_str) + 6));
- Create_Global_Str(gstr+'X5','cut and Paste... ^' + global_str('!BM_KEY5'));
- Create_Global_Str(gstr+'6','/M=meutil1^SAVEBLCK');
- Create_Global_Str(gstr+'X6',bsstr1 + 'save Block to disk...^' + global_str('!FM_KEY8') + bsstr2);
- {
- Create_Global_Str(gstr+'X6',bsstr1 + 'save Block to disk...^' + global_str('!BM_KEY6') + bsstr2);
- }
- Create_Global_Str(gstr+'7','/S=2/M=meutil2^indblk');
- Create_Global_Str(gstr+'X7',bsstr1 + 'Indent line block ^' + global_str('!BM_KEY7') + bsstr2);
- Create_Global_Str(gstr+'8','/S=2/M=meutil2^undblk');
- Create_Global_Str(gstr+'X8',bsstr1 + 'Undent line block ^' + global_str('!BM_KEY8') + bsstr2);
- Create_Global_Str(gstr+'9','');
- Create_Global_Str(gstr+'X9','|254');
- Create_Global_Str(gstr+'10','/S=2/M=meutil2^BlockOp /BT=3');
- Create_Global_Str(gstr+'X10','Window copy... ^' + global_str('!BM_KEY10'));
- Create_Global_Str(gstr+'11','/S=2/M=meutil2^BlockOp /BT=4');
- Create_Global_Str(gstr+'X11','window moVe... ^' + global_str('!BM_KEY11'));
- Create_Global_Str(gstr+'12','');
- Create_Global_Str(gstr+'X12','|254');
- Create_Global_Str(gstr+'13','/M=meutil2^blckmath');
- Create_Global_Str(gstr+'X13',bsstr1 + 'mAth operation... ^' + global_str('!BM_KEY13') + bsstr2);
- Create_Global_Str(gstr+'14','');
- Create_Global_Str(gstr+'X14','|254');
-
-
- do_xmenu:
- IF Marking THEN
- Create_Global_Str(gstr+'15','/S=2/M=meutil2^markblck');
- Create_Global_Str(gstr+'X15','End block ^' + global_str('!BM_KEY15'));
- count := 15;
- else
- Create_Global_Str(gstr+'15','/S=2/M=meutil2^MarkBlck');
- Create_Global_Str(gstr+'X15','mark Lines of text ^' + global_str('!BM_KEY15'));
- Create_Global_Str(gstr+'16','/S=2/M=meutil2^MColBlck');
- Create_Global_Str(gstr+'X16','mark cOlumns of text ^' + global_str('!BM_KEY16'));
- Create_Global_Str(gstr+'17','/S=2/M=meutil2^MStrBlck');
- Create_Global_Str(gstr+'X17','mark Stream of text ^' + global_str('!BM_KEY17'));
- count := 17;
- end;
- if block_stat <> 0 then
- ++count;
- Create_Global_Str(gstr+str(count),'/S=2/M=meutil2^blockoff');
- Create_Global_Str(gstr+'X'+str(count),'turn marking oFf ^' + global_str('!BM_KEY18'));
- end;
- RM('USERIN^SUBMENU /H=BL/GCLR=1/#='+str(count)+'/S=' +global_str(gstr+'0') +'/M=' + gstr + 'X' + '/L=BLOCK/G=' + gstr + MParm_Str);
- END_MACRO;
-
- $MACRO CPMENU TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: CPMENU
-
- Description: The cut and paste menu.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20], bsstr1[1], bsstr2[2] );
- IF block_stat = 0 THEN
- bsstr1 := '(';
- bsstr2 := ')|254';
- END;
- gstr := '!CPM!_';
- Create_Global_Str(gstr+'1','/S=2/M=meutil2^Cut');
- Create_Global_Str(gstr+'X1',bsstr1 + 'copy to Buffer ^' + global_str('!CPM_KEY1') + bsstr2);
- Create_Global_Str(gstr+'2','/S=2/M=meutil2^Cut /M');
- Create_Global_Str(gstr+'X2',bsstr1 + 'cut To buffer ^' + global_str('!CPM_KEY2') + bsstr2);
- Create_Global_Str(gstr+'3','/S=2/M=meutil2^Cut /A');
- Create_Global_Str(gstr+'X3',bsstr1 + 'Append to buffer ^' + global_str('!CPM_KEY3') + bsstr2);
- Create_Global_Str(gstr+'4','/S=2/M=meutil2^Cut /A /M');
- Create_Global_Str(gstr+'X4',bsstr1 + 'cut and aPpend to buffer ^' + global_str('!CPM_KEY4') + bsstr2);
- Create_Global_Str(gstr+'5','/S=2/M=meutil2^Paste');
- Create_Global_Str(gstr+'X5','copy From buffer ^' + global_str('!CPM_KEY5'));
- RM('USERIN^SUBMENU /H=CUTPASTE/A=1/GCLR=1/#=5/S=' +global_str(gstr+'0') +'/M=' + gstr + 'X' + '/L=CUT AND PASTE/G=' + gstr + MParm_Str);
- if return_int > 0 then
- return_int := 100;
- end;
- END_MACRO;
-
- $MACRO SRCHMENU;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: SRCHMENU
-
- Description: The search menu.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20] );
- gstr := '!SRM!_';
- Create_Global_Str(gstr+'1','/M=MEUTIL2^SEARCH');
- Create_Global_Str(gstr+'X1','Search for text... ^' + global_str('!SRM_KEY1'));
- Create_Global_Str(gstr+'2','/M=MEUTIL2^S_REPL');
- Create_Global_Str(gstr+'X2','search and Replace... ^' + global_str('!SRM_KEY2'));
- Create_Global_Str(gstr+'3','/M=MEUTIL2^REPSRCH');
- Create_Global_Str(gstr+'X3','repeat Previous search ^' + global_str('!SRM_KEY3'));
- Create_Global_Str(gstr+'4','');
- Create_Global_Str(gstr+'X4','|254');
- Create_Global_Str(gstr+'5','/M=MEUTIL2^FS');
- Create_Global_Str(gstr+'X5','multiple File search... ^' + global_str('!SRM_KEY5'));
- Create_Global_Str(gstr+'6','/M=MEUTIL2^FS /N');
- Create_Global_Str(gstr+'X6','List files from last search...^' + global_str('!SRM_KEY6'));
- do_xmenu:
- RM('USERIN^SUBMENU /H=SR/GCLR=1/#=6/M=' + gstr + 'X' + '/S=' +global_str(gstr+'0') +'/L=SEARCH/G=' + gstr + MParm_Str);
- END_MACRO;
-
- $MACRO CASEMENU TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: CASEMENU
-
- Description: The change case menu.
-
- Parameters:
- /U=
- 0 = Lower case mode
- 1 = Upper case mode
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20], label_str[40], ustr[4] );
-
- gstr := Str(global_int('MENU_LEVEL')) + 'MSTR_';
- if parse_int('/U=', mparm_str) then
- ustr := '/U=1';
- label_str := 'UPPER CASE';
- else
- ustr := '/U=0';
- label_str := 'LOWER CASE';
- end;
-
- Create_Global_Str(gstr+'1','/S=2/N=Line/M=TEXT^CHNGCASE /T=0' + ustr);
- Create_Global_Str(gstr+'2','/S=2/N=Word/M=TEXT^CHNGCASE /T=1' + ustr);
- Create_Global_Str(gstr+'3','/S=2/N=Block/M=TEXT^CHNGCASE /T=2' + ustr);
- RM('USERIN^SUBMENU /H=CNGCASE/GCLR=1/#=3/S=' +global_str(gstr+'0') +'/L=' + label_str + '/G=' + gstr + MParm_Str);
-
- END_MACRO;
-
- $MACRO SORTMENU TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: SORTMENU
-
- Description: The text sorting menu.
-
- Parameters:
- /X= The upper left column coordinate
- /Y= The upper left row coordinate
- /BC= Amount of boxes to kill upon exit.
-
- Global Variables:
- Global_Str('SORTPARMS') stores the following:
- /C= The starting column of sort key
- /L= Number of character in sort key
- /B The sort marked block flag
- /CASE Ignore case flag
- /D Descending order flag
-
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[80], ustr[4] );
- def_int( sort_col, sort_length, sort_mode, sort_case, sort_order );
- def_int( x1, y1 );
-
- x1 := parse_int('/X=', mparm_str);
- y1 := parse_int('/Y=', mparm_str);
- gstr := Global_Str('SORTPARMS');
- sort_col := Parse_Int('/C=', gstr);
- sort_length := Parse_Int('/L=', gstr);
- sort_mode := (xpos('/B', gstr, 1) <> 0);
- sort_case := (xpos('/CASE',gstr,1) <> 0);
- sort_order := (xpos('/D', gstr, 1) = 0);
-
- Set_Global_Str('IPARM_1','/T=>>>>/C=1/L=1/TP=6/W=10');
- Set_Global_Str('ISTR_1','START SORT');
- Set_Global_Int('IINT_2',sort_col);
- Set_Global_Str('IPARM_2','/T=Starting column of sort key................./TP=1/C=1/W=4/L=2');
- Set_Global_Int('IINT_3',sort_length);
- Set_Global_Str('IPARM_3','/T=Number of characters in sort key (0 = all)../TP=1/C=1/W=4/L=3');
- Set_Global_Int('IINT_4',sort_mode);
- Set_Global_Str('ISTR_4','/T=YES/F=NO');
- Set_Global_Str('IPARM_4','/T=Sort Marked Block Only....................../C=1/W=3/L=4/TP=5');
- Set_Global_Int('IINT_5',sort_case);
- Set_Global_Str('ISTR_5','/T=YES/F=NO');
- Set_Global_Str('IPARM_5','/T=Ignore Case................................./C=1/W=3/L=5/TP=5');
- Set_Global_Int('IINT_6',sort_order);
- Set_Global_Str('ISTR_6','/T=ASCENDING/F=DESCENDING');
- Set_Global_Str('IPARM_6','/T=Sort order................................../C=1/W=10/L=6/TP=5');
-
- RM('UserIn^Data_In /H=SORTTEXT/S=1/A=3/#=6/X=10/T=TEXT SORT/Y=' + str(y1));
-
- sort_order := global_int('IINT_6');
- sort_case := global_int('IINT_5');
- sort_mode := global_int('IINT_4');
- sort_length := global_int('IINT_3');
- sort_col := global_int('IINT_2');
- gstr := '/C=' + str(sort_col) + '/L=' + str(sort_length);
- if (sort_case) then
- gstr := gstr + '/CASE';
- end;
- if sort_mode then
- gstr := gstr + '/B';
- end;
- if sort_order = 0 then
- gstr := gstr + '/D';
- end;
- set_global_str('SORTPARMS', gstr);
- if return_int then
- X1 := parse_int('/BC=', mparm_str);
- while box_count > x1 do
- kill_box;
- end;
- RM('TEXT^TEXTSORT ' + gstr);
- return_int := 1;
- end;
-
- END_MACRO;
-
- $MACRO TEXTMENU;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: TEXTMENU
-
- Description: The text menu.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20] );
- gstr := '!TXM!_';
- Create_Global_Str(gstr+'1','/S=2/M=TEXT^UNDO');
- Create_Global_Str(gstr+'X1','Undo ^' + global_str('!TXM_KEY1'));
- Create_Global_Str(gstr+'2','/S=2/M=TEXT^UNDO /R');
- Create_Global_Str(gstr+'X2','Redo ^' + global_str('!TXM_KEY2'));
- Create_Global_Str(gstr+'3','');
- Create_Global_Str(gstr+'X3','|254');
- Create_Global_Str(gstr+'4','/S=1/M=SORTMENU');
- Create_Global_Str(gstr+'X4','Sort text... ^' + global_str('!TXM_KEY4'));
- Create_Global_Str(gstr+'5','/M=CASEMENU /U=1');
- Create_Global_Str(gstr+'X5','upper Case... ^' + global_str('!TXM_KEY5'));
- Create_Global_Str(gstr+'6','/M=CASEMENU /U=0');
- Create_Global_Str(gstr+'X6','Lower case... ^' + global_str('!TXM_KEY6'));
- Create_Global_Str(gstr+'7','/S=2/M=TEXT^CENTER');
- Create_Global_Str(gstr+'X7','cenTer line ^' + global_str('!TXM_KEY7'));
- Create_Global_Str(gstr+'8','/S=2/M=DATETIME');
- Create_Global_Str(gstr+'X8','Time/date stamp ^' + global_str('!TXM_KEY8'));
- Create_Global_Str(gstr+'9','/S=2/M=TEXT^RULER');
- Create_Global_Str(gstr+'X9','rulEr ^' + global_str('!TXM_KEY9'));
- Create_Global_Str(gstr+'10','');
- Create_Global_Str(gstr+'X10' ,'|254');
- Create_Global_Str(gstr+'11','/S=2/M=TEXT^REFORMAT');
- Create_Global_Str(gstr+'X11' ,'re-Format paragraph ^' + global_str('!TXM_KEY11'));
- Create_Global_Str(gstr+'12','/S=2/M=TEXT^JUSTIFY');
- Create_Global_Str(gstr+'X12' ,'Justify paragraph ^' + global_str('!TXM_KEY12'));
- Create_Global_Str(gstr+'13','/S=2/M=TEXT^UNJUSTIF');
- Create_Global_Str(gstr+'X13' ,'uN-justify paragraph ^' + global_str('!TXM_KEY13'));
- Create_Global_Str(gstr+'14','');
- Create_Global_Str(gstr+'X14' ,'|254');
- Create_Global_Str(gstr+'15','/S=2/M=MEUTIL1^REPEAT');
- Create_Global_Str(gstr+'X15' ,'rePeat command n times^' + global_str('!TXM_KEY15'));
- do_xmenu:
- RM('USERIN^SUBMENU /H=TEXTMENU/GCLR=1/#=15/M=' + gstr + 'X' + '/S=' +global_str(gstr+'0') +'/L=TEXT/G=' + gstr + MParm_Str);
- END_MACRO;
-
- $MACRO CURSRMENU;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: CURSMENU
-
- Description: The cursor menu.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20] );
- gstr := '!CRSM!_';
- Create_Global_Str(gstr+'1','/S=2/M=TEXT^MARKPOS');
- Create_Global_Str(gstr+'X1' ,'Push position onto marker stack^' + global_str('!CRSM_KEY1'));
- Create_Global_Str(gstr+'2','/S=2/M=TEXT^GOTOMARK');
- Create_Global_Str(gstr+'X2' ,'Get position from marker stack ^' + global_str('!CRSM_KEY2'));
- Create_Global_Str(gstr+'3','');
- Create_Global_Str(gstr+'X3' ,'|254');
- Create_Global_Str(gstr+'4','/M=TEXT^SET_MARK');
- Create_Global_Str(gstr+'X4' ,'Set random access mark... ^' + global_str('!CRSM_KEY4'));
- Create_Global_Str(gstr+'5','/M=TEXT^GET_MARK');
- Create_Global_Str(gstr+'X5' ,'Retrieve random access mark... ^' + global_str('!CRSM_KEY5'));
- Create_Global_Str(gstr+'6','');
- Create_Global_Str(gstr+'X6' ,'|254');
- Create_Global_Str(gstr+'7','/M=GOTOLINE');
- Create_Global_Str(gstr+'X7' ,'goto Line number... ^' + global_str('!CRSM_KEY7'));
- do_xmenu:
- RM('USERIN^SUBMENU /H=CURSMENU/GCLR=1/#=7/M=' + gstr + 'X' + '/S=' +global_str(gstr+'0') +'/L=CURSOR POSITION/G=' + gstr + MParm_Str);
- END_MACRO;
-
- $MACRO USERSETTABS TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: UserSetTabs
-
- Description: Prompts the user for a new fixed tab spacing.
-
- Parameters:
- /X= X coordinate for the prompt box
- /Y= Y coordinate for the prompt box
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- RETURN_INT := XPOS( '|16', format_line, 1 ) - 1;
- IF (Return_Int < 1) THEN
- Return_Int := 1;
- END;
-
- RM('USERIN^QUERYBOX /N=1/T=TAB SPACING/H=CHNGTABS/P=Input the tab spacing(1-99):/W=2/MIN=1/MAX=99' +
- '/C=' + parse_str('/X=', mparm_str) + '/L=' + parse_str('/Y=', mparm_str));
- IF return_str <> 'FALSE' THEN
- RM('SETTABS /TS=' + str( return_int ) );
- END;
- RETURN_INT := 0;
- END_MACRO;
-
-
- $MACRO LAYMENU;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: LAYMENU
-
- Description: The layout menu.
-
- Parameters:
- /X= X coordinate for the prompt box
- /Y= Y coordinate for the prompt box
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20], bstr[10] );
- gstr := '!LAYOUT!';
-
- Def_Int(J1,Tx,Ty,J2,J3);
- Def_Str(Tstr1);
-
- refresh := false;
- tx := parse_int('/X=', mparm_str);
- ty := parse_int('/Y=', mparm_str);
- bstr := '';
- j1 := 1;
-
- Doc_Menu2:
- {Create_Global_Str(gstr + '1','/H=EDITMODE');}
- Create_Global_Str(gstr + 'X1','Edit mode ^' + Copy(' TextDocument',(Doc_Mode * 8) + 1,8));
- {Create_Global_Str(gstr + '2','/H=WORDWRAP');}
- Create_Global_Str(gstr + 'X2','Wordwrap ^' + Copy('OffOn ',(Wrap_Stat * 3) + 1,3));
- {Create_Global_Str(gstr + '3','/H=INDSTYL');}
- Create_Global_Str(gstr + 'X3','Indent-style... ^' +
- Copy(' Off AutoSmart',(Indent_Style * 5) + 1,5));
- {Create_Global_Str(gstr + '4','/H=RTMARG');}
- Create_Global_Str(gstr + 'X4','right Margin... ^' + Str(Right_Margin));
- {Create_Global_Str(gstr + '5','/H=REFORMAT');}
- Create_Global_Str(gstr + 'X5','Reformat');
- {Create_Global_Str(gstr + '6','/H=JUSTIFY');}
- Create_Global_Str(gstr + 'X6','Justify');
- {Create_Global_Str(gstr + '7','/H=UNJUST');}
- Create_Global_Str(gstr + 'X7','Unjustify');
- {Create_Global_Str(gstr + '8','/H=EDFMTLIN');}
- Create_Global_Str(gstr + 'X8','edit-Formatline...');
- {Create_Global_Str(gstr + '9','/H=SVFORMATLIN');}
- Create_Global_Str(gstr + 'X9','Save-formatline ^' +
- Copy(' NoYes',(Format_Stat * 3) + 1,3));
- {Create_Global_Str(gstr + '10','/H=PRNFORM^FMTCODES');}
- Create_Global_Str(gstr + 'X10','format-Codes... ^'+ global_str('!LM_KEY10'));
- Create_Global_Str(gstr + '11','/S=2');
- Create_Global_Str(gstr + 'X11','Print-formatter ');
- Create_Global_Str(gstr + '12','/S=2');
- Create_Global_Str(gstr + 'X12','Auto-setup');
- {Create_Global_Str(gstr + '13','/H=DSPTABS');}
- Create_Global_Str(gstr + 'X13','Display tabs... ^' + Copy('Off On ',(display_tabs * 4) + 1,4));
- Create_Global_Str(gstr + '14','/M=UserSetTabs');
- Create_Global_Str(gstr + 'X14','change fixed Tab spacing...');
- RM('USERIN^SUBMENU /H=LAYOUT/GCLR=1/#=14/M=' + gstr + 'X' + '/S=' +global_str(gstr+'0') +'/L=LAYOUT/G=' + gstr + bstr + MParm_Str);
- bstr := '/B=1/BO=1';
- J1 := return_int;
-
- IF J1 = 1 THEN
- Doc_Mode := NOT(Doc_Mode);
- GOTO Doc_Menu2;
- elsIF J1 = 5 THEN
- call clear_box;
- RM( 'TEXT^reformat' );
- GOTO Menu_Exit;
- elsIF J1 = 2 THEN
- Wrap_Stat := NOT(Wrap_Stat);
- GOTO Doc_Menu2;
- elsIF J1 = 3 THEN
- RM('USERIN^XMENU /B=1/L=INDENT STYLE/X=' + str(tx + 4) + '/Y=' + str(ty+4) + '/S=' + str(indent_style + 1) +
- '/M=Off(LAYOUT)Auto()Smart()');
- j2 := return_int;
- IF j2 > 0 THEN
- Indent_Style := J2 - 1;
- J2 := C_Col;
- Goto_Col(1);
- Set_Indent_Level;
- Goto_Col(J2);
- END;
- Goto Doc_Menu2;
- elsIF J1 = 4 THEN
- Return_Int := Right_Margin;
- RM('userin^QUERYBOX /MIN=1/MAX=2048/N=1/H=RTMARG/C=' + Str(Tx + 6) + '/L=' +
- Str(Ty + 2) + '/W=4/T=RIGHT MARGIN');
- IF (Return_Str = 'TRUE') THEN
- Tstr1 := Format_Line;
- J3 := Pos('R',Format_Line);
- If J3 = 0 THEN
- J3 := Pos('r',Format_Line);
- END;
- If J3 <> 0 THEN
- Format_Line := Str_Del(Format_Line,J3,1);
- Format_Line := Str_Ins(' ',Format_Line,J3);
- END;
- Format_Line := Str_Del(Format_Line,Return_Int,1);
- Format_Line := Str_Ins('R',Format_Line,Return_Int);
-
- Right_Margin := Return_Int;
- END;
- GOTO Doc_Menu2;
- elsIF J1 = 6 THEN
- call clear_box;
- RM( 'TEXT^JUSTIFY' );
- elsIF J1 = 7 THEN
- call clear_box;
- RM( 'TEXT^UNJUSTIF' );
- elsIF J1 = 8 THEN
- call clear_box;
- Refresh := True;
- Redraw;
- RM( 'meutil1^EdFormat' );
- elsIF J1 = 9 THEN
- Format_Stat := Not(Format_Stat);
- file_changed := true;
- Goto Doc_Menu2;
- elsIF J1 = 10 THEN
- call clear_box;
- RM( 'document^FCMD' );
- elsIF J1 = 11 THEN
- call clear_box;
- RM( 'document^FPRINT' );
- elsIF J1 = 12 THEN
- call clear_box;
- RM( 'EXTSETUP' );
- return_int := 100;
- elsIF J1 = 13 THEN
- Display_Tabs := Not(Display_Tabs);
- redraw;
- Goto Doc_Menu2;
- END;
- goto menu_exit;
-
- clear_box:
- while box_count > 0 DO
- kill_box;
- end;
- ret;
-
- menu_exit:
-
- END_MACRO;
-
- $MACRO MACMENU;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: MACMENU
-
- Description: The macro menu.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20] );
-
- gstr := '!MCM!_';
- Create_Global_Str(gstr + '1','/M=meutil1^RUNMAC');
- Create_Global_Str(gstr + 'X1','Run a macro... ^' + global_str('!MCM_KEY1'));
- Create_Global_Str(gstr + '2','/M=LOADMACRO');
- Create_Global_Str(gstr + 'X2','Load a macro file...^' + global_str('!MCM_KEY2'));
- Create_Global_Str(gstr + '3','/M=MEDEBUG^DEBUG');
- Create_Global_Str(gstr + 'X3','Debug a macro... ^' + global_str('!MCM_KEY3'));
- Create_Global_Str(gstr+'4','');
- Create_Global_Str(gstr+'X4' ,'|254');
- Create_Global_Str(gstr + '5','/M=LISTMACS');
- Create_Global_Str(gstr + 'X5','list All macros ^' + global_str('!MCM_KEY5'));
- Create_Global_Str(gstr + '6','/M=LISTGLOB');
- Create_Global_Str(gstr + 'X6','list all Globals ^' + global_str('!MCM_KEY6'));
- Create_Global_Str(gstr+'7','');
- Create_Global_Str(gstr+'X7' ,'|254');
- Create_Global_Str(gstr + '8','/S=2/M=KEYMAC^KEYMAC_LIST');
- Create_Global_Str(gstr + 'X8','Keystroke macros... ^' + global_str('!MCM_KEY8'));
- RM('USERIN^SUBMENU /H=MC/GCLR=1/#=8/M=' + gstr + 'X' + '/S=' +global_str(gstr+'0') +'/L=MACRO/G=' + gstr + MParm_Str);
- END_MACRO;
-
- $MACRO LOADMACRO TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: LOADMACRO
-
- Description: Prompts for a macro to load.
-
- Parameters:
- /X= The upper left column coordinate
- /Y= The upper left row coordinate
- /BC= Number of boxes to kill upon exit
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_int(jx);
-
- Return_Str := '';
- RM('userin^USERSTR /HISTORY=MACRO_HISTORY/H=MC/X=' +
- parse_str('/X=', mparm_str) +
- '/Y=' + parse_str('/Y=',mparm_str) +
- '/B=1/W=39/ML=80/BL=Macro file to load');
- IF (Return_Int) THEN
- Load_Macro_File(Return_Str);
- if error_level <> 0 then
- RM('MEERROR');
- return_int := 0;
- else
- jx := parse_int('/BC=', mparm_str);
- while box_count > jx do
- kill_box;
- end;
- make_message('Macro file "' + return_str + '" loaded.');
- return_int := 100;
- end;
- END;
- END_MACRO;
-
- $MACRO LISTMACS TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: LISTMACS
-
- Description: Builds a list of macros currently in memory.
-
- Parameters:
- /X= The upper left column coordinate
- /Y= The upper left row coordinate
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- Def_Str( TStr, mstr );
- Def_Int( str_count, x, y, jx );
- x := parse_int( '/X=', mparm_str );
- y := parse_int( '/Y=', mparm_str );
-
- working;
- mstr := '';
- str_count := 0;
- TStr := First_Macro;
- Loop:
- IF TStr <> '' THEN
- if svl(mstr) > 200 then
- ++str_count;
- create_global_str('@@' + str(str_count),mstr);
- mstr := '';
- end;
- mstr := mstr + tstr + '(XX)';
- TStr := Next_Macro;
- Goto Loop;
- END;
- if svl(mstr) > 0 then
- ++str_count;
- create_global_str('@@' + str(str_count),mstr);
- end;
- RM('USERIN^DVMENU /P=@@/X=' + str(x) + '/Y=' + str(y) +
- '/T=LOADED MACROS/H=MC/B=1/K=1/I=%/#=' + str(str_count));
- jx := 0;
- while jx < str_count do
- ++jx;
- set_global_str('@@' + str(jx), '');
- end;
- Return_Int := 0;
-
- END_MACRO;
-
- $MACRO LISTGLOB TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: LISTGLOB
-
- Description: Builds a list of globals currently in memory.
-
- Parameters:
- /X= The upper left column coordinate
- /Y= The upper left row coordinate
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- Def_Str( astr[20], TStr[40] );
- Def_Int( x, y, attr, jx, twindow, tr, tbc );
- x := parse_int( '/X=', mparm_str );
- y := parse_int( '/Y=', mparm_str );
- tbc := box_count;
- tr := refresh;
- refresh := false;
- working;
- twindow := window_id;
- switch_window( window_count );
- create_window;
- aStr := First_Global( attr );
- Loop:
- IF aStr <> '' THEN
- tstr := astr + copy(' ', 1, 21 - svl(astr) );
- if attr = 0 then
- tstr := tstr + 'STRING' ;
- else
- tstr := tstr + 'INTEGER' ;
- end;
- if key1 = 27 then
- goto exit;
- end;
- put_line( tstr );
- down;
- aStr := Next_Global( attr );
- Goto Loop;
- END;
- tof;
- again:
- call clear_boxs;
- RM('USERIN^DVMENU /WW=35/P=@@/X=' + str(x - 10) + '/Y=' + str(y) + '/WIN=' + str(cur_window) +
- '/T=GLOBAL VARIABLES/H=MC/B=1/K=0/I=%/SN=' + str(c_line));
- IF return_int > 0 THEN
- tstr := shorten_str( copy(return_str,1,20));
- IF copy( return_str, 22, 1) = 'S' THEN
- return_str := global_str( tstr );
- rm('USERIN^QUERYBOX /T=GLOBAL_STR(''' + tstr + ''')/W=70/ML=2048');
- IF return_int THEN
- set_global_str( tstr, return_str );
- END;
- ELSE
- return_int := GLOBAL_INT( tstr );
- rm('USERIN^QUERYBOX /T=GLOBAL_INT(''' + tstr + ''')/W=20/N=1');
- IF return_str = 'TRUE' THEN
- set_global_int( tstr, return_int );
- END;
- END;
- Goto again;
- END;
- goto exit;
-
- clear_boxs:
- while box_count > tbc do
- kill_box;
- END;
- ret;
-
- exit:
- call clear_boxs;
- refresh := false;
- delete_window;
- switch_win_id( twindow );
- Return_Int := 0;
- refresh := tr;
- END_MACRO;
-
- $MACRO MISCMENU;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: MISCMENU
-
- Description: The "OTHER" menu.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( gstr[20] );
- gstr := '!MIM!_';
- Create_Global_Str(gstr+'1','/S=2/M=USER');
- Create_Global_Str(gstr+'X1','User menu ^' + global_str('!MIM_KEY1'));
- Create_Global_Str(gstr+'2','/S=2/M=SETUP');
- Create_Global_Str(gstr+'X2','Installation and setup ^' + global_str('!MIM_KEY2'));
- Create_Global_Str(gstr+'3','');
- Create_Global_Str(gstr+'X3' ,'|254');
- Create_Global_Str(gstr+'4','/S=2/M=language^compile');
- Create_Global_Str(gstr+'X4','Execute compiler or program^' + global_str('!MIM_KEY4'));
- Create_Global_Str(gstr+'5','/S=2/M=language^cmperror');
- Create_Global_Str(gstr+'X5','find neXt compiler error ^' + global_str('!MIM_KEY5'));
- Create_Global_Str(gstr+'6','/S=2/M=language^template');
- Create_Global_Str(gstr+'X6','build Template ^' + global_str('!MIM_KEY6'));
- Create_Global_Str(gstr+'7','/S=2/M=language^match');
- Create_Global_Str(gstr+'X7','Match language structure ^' + global_str('!MIM_KEY7'));
- Create_Global_Str(gstr+'8','');
- Create_Global_Str(gstr+'X8' ,'|254');
- Create_Global_Str(gstr+'9','/S=2/M=calc');
- Create_Global_Str(gstr+'X9','Calculator ^' + global_str('!MIM_KEY9'));
- Create_Global_Str(gstr+'10','/S=2/M=support^ascii');
- Create_Global_Str(gstr+'X10','Ascii table ^' + global_str('!MIM_KEY10'));
- Create_Global_Str(gstr+'11','/S=2/M=support^condense');
- Create_Global_Str(gstr+'X11','coNdense display ^' + global_str('!MIM_KEY11'));
- Create_Global_Str(gstr+'12','/S=2/M=meutil1^shelldos');
- Create_Global_Str(gstr+'X12','shell to DOS ^' + global_str('!MIM_KEY12'));
- Create_Global_Str(gstr+'13','/S=2/M=support^linedraw');
- Create_Global_Str(gstr+'X13','Linedraw ^' + global_str('!MIM_KEY13'));
- Create_Global_Str(gstr+'14','');
- Create_Global_Str(gstr+'X14' ,'|254');
- Create_Global_Str(gstr+'15','/S=2/M=mecom^com');
- Create_Global_Str(gstr+'X15','teRminal ^' + global_str('!MIM_KEY15'));
- Create_Global_Str(gstr+'16','/M=spell^spell');
- Create_Global_Str(gstr+'X16','Spell check... ^' + global_str('!MIM_KEY16'));
- do_xmenu:
- RM('USERIN^SUBMENU /H=OTHER/GCLR=1/#=16/M=' + gstr + 'X' + '/S=' +global_str(gstr+'0') +'/L=OTHER/G=' + gstr + MParm_Str);
- END_MACRO;
-
-
- $MACRO USER TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: USER
-
- Description: This macro generates a menu of programs and macros that
- the user may select, add to, delete or modify.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- def_int( ct, rs, sm, cmd, jx, old_sr, smem );
- def_str( hf[40] );
- refresh := false;
- RM('USERIN^DB /F=MECONFIG.DB/NOALHPA=1/2TOP=1/DPT=USER.DB/LT=User Menu/LO=2/H=USER/GLO=@USER@');
- IF return_int = 1 THEN
- return_str := parse_str('CMD=', global_str('@USER@'));
- RM( 'XlateCmdLine /F=' + file_name);
- ct := parse_int( 'TYPE=', global_str( '@USER@'));
- IF ct < 2 THEN
- RM( return_str );
- ELSIF ct = 2 THEN
- old_sr := status_row;
- status_row := 0;
- smem := (parse_int('SWAP_MEM=', global_str('@USER@') ) * 1024) / 16;
- sm := parse_int('SWAP=', global_str('@USER@'));
- IF sm > 4 THEN
- sm := 0;
- END;
- rs := parse_int('REST=', global_str('@USER@')) < 2;
- cmd := parse_int('USECMD=', global_str('@USER@')) < 2;
-
- RM( 'MEUTIL1^EXEC /SWAP=' + str(sm) + '/MEM=' + str(smem) +
- '/CMD=' + str(cmd) + '/SCREEN=' + str(rs) );
- status_row := old_sr;
- New_Screen;
- ELSIF ct = 3 THEN
- jx := XPOS('^', return_str, 1);
- IF jx = 0 THEN
- jx := length(return_str);
- END;
- hf := copy( return_str, 1, jx - 1);
- return_str := copy( return_str, jx + 1, 254 );
- update_status_line;
- RM('MEHELP /F=' + hf + '/LK=' + return_str );
- ELSIF ct = 4 THEN
- IF switch_file( caps(return_str) ) THEN
- make_message( truncate_path(return_str) + ' already loaded.');
- ELSE
- RM('LDFILES /LC=1');
- END;
- END;
- END;
- END_MACRO;
-
- $MACRO PRINTSTR TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: PRINTSTR
-
- Description: Sends a string of text to a file or device such as the printer.
-
- Parameters:
- /H= File handle. Since file handle 0 (Stdin) is perfectly legal,
- You MUST include /H=0 if you wish to use Stdin. If /H= is
- not a part of the parameter string, Error_Level will be set.
- It is the calling macro's responsibility to be sure the file
- or device is open.
- /S=
- 0 = Normal print
- 1 = Check device status before printing
-
- Returns:
- Will set ERROR_LEVEL if there is an error, however, it is the
- calling macro's responsibility to process the error.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- Def_Str(Temp_Str[2048]);
- Def_Int(Handle,Byte_Count,Error);
-
- IF (XPos('/H=',MParm_Str,1) = 0) THEN
- Error_Level := 3006;
- Goto EXIT;
- END;
-
- Handle := Parse_Int('/H=',MParm_Str);
-
- {Check ready status of file or device}
- IF (Parse_Int('/S=',MParm_Str)) THEN
- R_AX := $4407;
- R_BX := Handle;
- Intr($21);
- IF ((R_AX and $00FF) <> $FF) THEN
- Goto DEVICE_NOT_READY;
- END;
- {Change character device to "raw" mode.}
- R_AX := $4400;
- R_BX := Handle;
- Intr($21);
- IF ((R_Flags and $01) = 0) THEN
- R_DX := (R_DX or $20) and $FF;
- R_AX := $4401;
- R_BX := Handle;
- Intr($21);
- END;
- END;
-
- {Write string to file or device}
- Error := S_Write_Bytes(Return_Str,Handle,Byte_Count);
- IF (Error) THEN
- Error_Level := Error + 3000;
- ELSE
- IF (Byte_Count < Length(Return_Str)) THEN
- Error_Level := 3241;
- END;
- END;
- Goto EXIT;
-
- DEVICE_NOT_READY:
- Error_Level := 2002;
-
- EXIT:
-
- END_MACRO;
-
- $MACRO PRINT_FILE_BLOCK TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: PRINT_FILE_BLOCK
-
- Description: Sends the current file or currently marked block to the printer.
-
- Parameters:
- /B= If 1, print block else print whole file
- /X= The upper left column coordinate
- /Y= The upper left row coordinate
- /H= Handle of the printer device or file.
- /C= Number of copies to print. Defaults to 1.
- /LN= Print line numbers to the left of each line.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_int(ul_col,ul_row,jx,Handle,Copy_Count,Line_Count,
- Line_Numbers,Block);
- def_str(temp_string, margin_str[80], sstr[10] );
-
- Copy_Count := Parse_Int('/C=',MParm_Str);
- Line_Numbers := Parse_Int('/LN=',MParm_Str);
- Handle := Parse_Int('/H=',MParm_Str);
- Block := Parse_Int('/B=',MParm_Str);
-
- refresh := false;
- sstr := ' /S=1';
- jx := 1;
- margin_str := '';
- while jx < print_margin do
- margin_str := margin_str + ' ';
- ++jx;
- end;
-
- ul_col := parse_int('/X=', mparm_str);
- if ul_col = 0 then
- ul_col := 10;
- end;
- ul_row := parse_int('/Y=', mparm_str);
- if ul_row = 0 then
- ul_row := 6;
- end;
-
- Temp_String := 'PRINTING';
- IF (Block) THEN
- If (Block_Stat = 0) THEN
- beep;
- goto NO_BLOCK;
- END;
- Temp_String := Temp_String +' BLOCK';
- block_end;
- END;
-
- Put_Box(UL_COL,UL_ROW,UL_COL + 26,UL_ROW + 3,0,m_b_color,Temp_String,True );
- Write('Press <ESC> to abort.',Ul_Col + 1,Ul_Row + 1,0,m_s_Color);
- Mark_Pos;
-
- PRINT_AGAIN:
- IF (Block) THEN
- GOTO_LINE( BLOCK_LINE1 );
- ELSE
- Tof;
- END;
- Line_Count := 0;
- PRINT_LINE:
- ++Line_Count;
- IF CHECK_KEY THEN
- IF KEY1 = 27 THEN
- Goto EXIT;
- END;
- END;
- Temp_String := Get_Line;
- Tabs_To_Spaces(Temp_String);
- IF (Block) THEN
- {Special processing for column and stream block modes}
- If (BLOCK_STAT = 2) Then
- Temp_String := Copy(Temp_String,BLOCK_COL1,(BLOCK_COL2 - BLOCK_COL1) + 1);
- End;
- If (BLOCK_STAT = 3) Then
- IF (C_LINE = BLOCK_LINE1) THEN
- Temp_String := Copy(Temp_String,BLOCK_COL1,255);
- END;
- IF (C_LINE = BLOCK_LINE2) THEN
- IF (C_LINE = BLOCK_LINE1) THEN
- Temp_String := Copy(Temp_String,1,(BLOCK_COL2 - BLOCK_COL1) + 1);
- ELSE
- Temp_String := Copy(Temp_String,1,BLOCK_COL2);
- END;
- END;
- End;
- END;
- {Strip out HARD_CR if present}
- IF (Hard_Cr <> '|0') THEN
- STRIP_HARD_CR:
- Jx := XPos(Hard_Cr,Temp_String,1);
- IF (Jx) THEN
- Temp_String := Str_Del(Temp_String,Jx,1);
- Goto STRIP_HARD_CR;
- END;
- END;
-
- IF (Line_Numbers) THEN
- Return_Str := Margin_Str + Copy(Str(Line_Count) + ' ',1,8) +
- Temp_String + Line_Terminator;
- ELSE
- Return_Str := margin_str + temp_string + Line_Terminator;
- END;
- Call PRINT_STRING;
- sstr := ' ';
- DOWN;
- IF (Block) THEN
- IF (C_LINE <= BLOCK_LINE2) THEN
- Goto PRINT_LINE;
- END;
- ELSE
- IF (Not(At_Eof)) THEN
- Goto PRINT_LINE;
- END;
- END;
-
- --Copy_Count;
- IF (Copy_Count > 0) THEN
- Return_Str := '|13|12';
- Call PRINT_STRING;
- Goto PRINT_AGAIN;
- END;
- Goto EXIT;
-
- PRINT_STRING:
- RM('PRINTSTR' + sstr + '/H=' + Str(Handle));
- sstr := ' ';
- IF (Error_Level) THEN
- Beep;
- RM('MEERROR^ERRMSG');
- RM('USERIN^VERIFY /T=Abort printing?/H=PR' + '/BL=ERROR: ' +
- Caps(Return_Str) + '/C=' + Str(Ul_Col + 2) + '/L=' + Str(Ul_Row + 1));
- IF (Return_Int = 0) THEN
- Delay(1000);
- Goto PRINT_STRING;
- END;
- Goto EXIT;
- END;
- RET;
-
- EXIT:
- Kill_Box;
- Goto_Mark;
- NO_BLOCK:
- return_int := 0;
- END_MACRO;
-
- $MACRO OPEN_CLOSE_FILE TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: OPEN_CLOSE_FILE
-
- Description: Opens or closes a file or device.
-
- Parameters:
- /M= Mode If 1, create new file, if 2 open existing file, if 0,
- close the file.
- /FN= File name. Required if M > 0.
-
- Returns:
- Error_Level > 0 if an error occurred.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- Def_Int(Open_Mode,Error,Handle);
- Def_Str(F_Name[80]);
-
- Return_Int := 0;
- Open_Mode := Parse_Int('/M=',MParm_Str);
- F_Name := Parse_Str('/FN=',MParm_Str);
- Handle := 0;
- IF (Open_Mode = 1) THEN
- {Create the file}
- Error := S_Create_File(F_Name,Handle);
- ELSIF (Open_Mode = 2) THEN
- Error := S_Open_File(F_Name,1,Handle);
- ELSE
- Error := S_Close_File(Parse_Int('/H=',MParm_Str));
- END;
-
- IF (Error) THEN
- Error_Level := 3000 + Error;
- ELSE
- Return_Int := Handle;
- Error_Level := 0;
- END;
-
- END_MACRO;
-
- $MACRO PRINT;
- {******************************************************************************
- MULTI-EDIT MACRO
-
-
- Name: PRINT
-
- Description: This is the print menu. This provides printing of files and
- parts of files, and printer control.
-
- Parameters:
- /X= The upper left column coordinate
- /Y= The upper left row coordinate
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- Def_Int(Jx,Jy,UL_COL,UL_ROW,T_Line,T_Col,Temp_Integer,Exit_Result,Handle,
- error,Copy_Count,Line_Numbers);
-
- Def_Str(Control_Codes,Control_Code,Temp_String,Printer_Type[40],
- T_Word_Delimits[40], gstr[20], bstr[10],printer_device[40]);
-
- T_Word_Delimits := Word_Delimits;
- Handle := 0;
- Word_Delimits := '/';
- gstr := Str(global_int('MENU_LEVEL')) + 'PRNMEN_';
- bstr := '';
- REFRESH := FALSE;
- Exit_Result := 0;
- Messages := False;
- Copy_Count := 1;
- Line_Numbers := 0;
- ul_col := parse_int('/X=', mparm_str);
- if ul_col = 0 then
- ul_col := 10;
- end;
- ul_row := parse_int('/Y=', mparm_str);
- if ul_row = 0 then
- ul_row := 6;
- end;
-
-
- Printer_Type := Parse_Str('PT=',Global_Str('PRINTER_TYPE'));
- If (Printer_Type = '') Then
- Temp_Integer := 4;
- Else
- Temp_Integer := 1;
- End;
- printer_device := Global_Str('PRINTER_DEVICE');
- IF (Printer_device = '') THEN
- Printer_Device := 'PRN';
- Set_Global_Str('PRINTER_DEVICE',Printer_device);
- END;
-
- Jx := 1;
-
-
- SET_CODES:
- Printer_Type := Parse_Str('PT=',Global_Str('PRINTER_TYPE'));
- CODES_SET:
-
- PRINT_MENU:
- {Create_Global_Str(gstr+'1','/H=PR');}
- Create_Global_Str(gstr+'X1','print current File ');
- {Create_Global_Str(gstr+'2','');}
- Create_Global_Str(gstr+'X2','print marked Block');
- {Create_Global_Str(gstr+'3','');}
- Create_Global_Str(gstr+'X3' ,'|254');
- {Create_Global_Str(gstr+'4','');}
- Create_Global_Str(gstr+'X4','printer Setup...');
- {Create_Global_Str(gstr+'5','');}
- Create_Global_Str(gstr+'X5','printer Type...^' + printer_type);
- {Create_Global_Str(gstr+'6','');}
- Create_Global_Str(gstr+'X6','printer Device/file...^' + printer_device);
- {Create_Global_Str(gstr+'7','');}
- Create_Global_Str(gstr+'X7' ,'|254');
- {Create_Global_Str(gstr+'8','');}
- Create_Global_Str(gstr+'X8','Copies to print...^' + Str(Copy_Count));
- {Create_Global_Str(gstr+'9','');}
- Create_Global_Str(gstr+'X9','Line numbering ^' + Copy('OffOn',(Line_Numbers * 3) + 1,3));
- {Create_Global_Str(gstr+'10','');}
- Create_Global_Str(gstr+'X10','print Margin...^' + Str(Print_Margin));
- {Create_Global_Str(gstr+'11','');}
- Create_Global_Str(gstr+'X11','eject Page');
- RM('USERIN^SUBMENU /H=PR/GCLR=1/#=11/M=' + GSTR + 'X/S=' +global_str(gstr+'0') +'/L=PRINT/G=' + gstr + bstr + MParm_Str);
- bstr := '/B=1/BO=1';
- temp_integer := return_int;
-
- IF Temp_Integer <= 0 THEN
- exit_result := temp_integer;
- Goto END_OF_MAC;
- END;
-
- IF ((Temp_Integer = 1) or (Temp_Integer = 2) or (Temp_Integer = 10)) THEN
- IF (Handle = 0) THEN
- Call OPEN_PRINTER_DEVICE;
- IF (Error) THEN
- Goto PRINT_MENU;
- END;
- END;
- END;
-
- IF (Temp_Integer = 1) THEN
- RM('PRINT_FILE_BLOCK /C=' + str(Copy_Count) + '/H=' + Str(Handle) + '/LN='
- + Str(Line_Numbers));
- RM('OPEN_CLOSE_FILE /H=' + Str(Handle));
- Handle := 0;
- END;
-
- IF (Temp_Integer = 2) THEN
- RM('PRINT_FILE_BLOCK /B=1/C=' + str(Copy_Count) + '/H=' + Str(Handle) + '/LN='
- + Str(Line_Numbers));
- END;
-
- IF (Temp_Integer = 6) THEN {Printer Device}
- RM('USERIN^DB /PRE=PRN/F=MECONFIG.DB/DPT=PRN_DEV.DB/LO=1/U=1/LT=PRINTER DEVICE//FILE/H=PR/X=' + str(ul_col + 1) +
- '/Y=' + str( ul_row + 10));
- IF (Return_Int) THEN
- {If they change the printer type, we need to save this in install.}
- IF (Return_Str <> Printer_Device) THEN
- Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01);
- END;
- Printer_Device := Return_Str;
- Set_Global_Str('PRINTER_DEVICE',Printer_device);
- IF (Handle) THEN
- RM('OPEN_CLOSE_FILE /H=' + Str(Handle));
- Handle := 0;
- END;
- END;
- Goto PRINT_MENU;
- END;
-
- IF (Temp_Integer = 4) THEN {Printer setup}
- If (Printer_Type = '') Then
- {Choice is invalid if no printer type is defined}
- Call WRONG;
- Goto PRINT_MENU;
- End;
- Call SETUP_MENU;
- Goto PRINT_MENU;
- END;
-
- IF (Temp_Integer = 8) THEN {Number of copies to print}
- Return_Int := Copy_Count;
- RM('userin^QUERYBOX /MIN=0/MAX=999/N=1/P= /H=PR/C=' +
- Str(Ul_Col + 2) + '/L='
- + Str(Ul_Row + 9) + '/W=3/T=NUMBER OF COPIES');
- IF (Return_Str = 'TRUE') THEN
- Copy_Count := Return_Int;
- End;
- Goto PRINT_MENU;
- END;
-
- IF (Temp_Integer = 9) THEN {Line Numbering}
- Line_Numbers := Not(Line_Numbers);
- Goto PRINT_MENU;
- END;
-
- IF (Temp_Integer = 10) THEN {Print margin}
- Return_Int := Print_Margin;
- RM('userin^QUERYBOX /MIN=0/MAX=133/N=1/P= /H=PR/C=' +
- Str(Ul_Col + 2) + '/L='
- + Str(Ul_Row + 10) + '/W=3/T=PRINT MARGIN');
- IF (Return_Str = 'TRUE') THEN
- Print_Margin := Return_Int;
- End;
- Goto PRINT_MENU;
- END;
-
- If (Temp_Integer = 5) Then {Select printer type}
- RM( 'setup^Prttype ' + '/X=' + Str(Ul_Col + 1) + '/Y=' + Str(Ul_Row + 6));
- Goto SET_CODES;
- End;
-
- If (Temp_Integer = 11) THEN
- Call EJECT_PAGE;
- END;
-
- Goto PRINT_MENU;
-
- EJECT_PAGE:
- IF (Handle = 0) THEN
- Call OPEN_PRINTER_DEVICE;
- IF (Error) THEN
- Ret;
- END;
- END;
- {Move to end of existing file. This is intended for files only, but it
- seems to generate a benign error code 6. Unless the error turns out to cause
- a problem, I don't see any need to check to see if the handle is a file or a
- device}
- Error := S_Move_File_Ptr(handle,2,0);
-
- Return_Str := '|12';
- RM('PRINTSTR /S=1/H=' + Str(Handle));
- IF (Error_Level) THEN
- RM('Meerror');
- END;
- RET;
-
- OPEN_PRINTER_DEVICE:
- Error := 0;
- {Open the printer device/file. Try to open an existing file first.}
- RM('OPEN_CLOSE_FILE /M=2/FN=' + Global_Str('PRINTER_DEVICE'));
- IF (Error_Level) THEN
- {If it doesn't exist, create.}
- IF (Error_Level = 3002) THEN
- RM('OPEN_CLOSE_FILE /M=1/FN=' + Global_Str('PRINTER_DEVICE'));
- IF (Error_Level = 0) THEN
- Goto OPEN_OK;
- END;
- END;
- RM('MEERROR');
- Error := 1;
- Ret;
- END;
- OPEN_OK:
- Handle := Return_Int;
- Ret;
-
- WRONG:
- Beep;
- Put_Box( UL_COL, UL_ROW + 3, UL_COL + 29 ,UL_ROW + 6,
- 0,Error_Color,'ERROR',True );
- Write('Select printer type first!',Ul_Col + 1,Ul_Row + 4,0,Error_Color);
- Write('Press any key to continue',Ul_Col + 2,Ul_Row + 5,0,Error_Color);
- Read_Key;
- Kill_Box;
- Temp_Integer := 7;
- RET;
-
- SETUP_MENU:
- RM('PRINT_CODE_MENU /C=1/X=' + str(ul_col + 1) + '/Y=' + str( ul_row + 5));
- IF (Return_Int = -1) THEN
- RET;
- END;
- IF (Parse_Str('/C=',Return_Str) <> '') THEN
- IF (Handle = 0) THEN
- Call OPEN_PRINTER_DEVICE;
- IF (Error) THEN
- Ret;
- END;
- END;
-
- Return_Str := Parse_Str('/C=',Return_Str);
- RM('PRINTSTR /S=1/H=' + Str(Handle));
- IF (Error_Level) THEN
- RM('Meerror');
- END;
- ELSE
- Error_Level := 2010;
- RM('MEERROR /EM=PRINTER CODE FOR: ' + Parse_Str('/N=',Return_Str) + ' NOT FOUND');
- END;
- RET;
-
- END_OF_MAC:
- IF (Handle) THEN
- RM('OPEN_CLOSE_FILE /H=' + Str(Handle));
- END;
-
- if error_level <> 0 then
- RM('MEERROR');
- end;
- Word_Delimits := T_Word_Delimits;
- Return_Int := Exit_Result;
- Messages := True;
- END_MACRO;
-
- $MACRO PRINT_CODE_MENU TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: PRINT_CODE_MENU
-
- Description: Provides a menu of printer codes from the currently selected
- printer type.
-
- Parameters:
- /F=1 will only display printer code names that have print
- formatter codes associated with them.
- /C=1 will only display printer code names that have printer
- escape sequences associated with them.
-
- Returns:
- Return_Str:
- /N= The name of the selected code
- /F= The print format code
- /C= The printer escape sequence for that code
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- Def_Int(Counter,Format_Only,Code_Only,Choice);
- Def_Str(TStr[2048],SStr[90],Code_Name[20] );
-
- Format_Only := Parse_Int('/F=',MParm_Str);
- Code_Only := Parse_Int('/C=',MParm_Str);
- Tstr := Global_str('PRINTER_TYPE');
- Return_Str := '';
- SStr := '';
- Counter := 0;
- Choice := 0;
- WHILE (Counter < 18) DO
- ++Counter;
- Code_Name := Parse_Str('N' + Str(Counter) + '=',TSTR);
- IF (Code_Name <> '') THEN
- IF (Format_Only) THEN
- IF (Parse_Str('F' + Str(Counter) + '=',Tstr) = '') THEN
- Goto SKIP_IT;
- END;
- END;
- IF (Code_Only) THEN
- IF (Parse_Str('C' + Str(Counter) + '=',TSTr) = '') THEN
- Goto SKIP_IT;
- END;
- END;
- ++Choice;
- Set_Global_Str('XFCS_' + Str(Choice),Code_Name);
- Set_Global_Str('FCS_' + Str(Choice),'/S=2');
- SStr := SStr + '/' + Str(Choice) + '=' + Str(Counter);
- END;
- SKIP_IT:
- END;
-
- IF (Choice) THEN
- RM('SUBMENU /H=PR/A=1/GCLR=1/G=FCS_/M=XFCS_/L=SELECT A PRINTER CODE' +
- '/#=' + str(choice) + '/BC=' + str(box_count) + MParm_Str);
-
- IF (Return_Int > 0) THEN
- {Now, parse out the corresponding printer code}
- Code_Name := Parse_Str('/' + Str(Return_Int) + '=',sstr);
- Return_Str :=
- '/N=' + Parse_Str('N' + Code_Name + '=',Tstr) +
- '/F=' + Parse_Str('F' + Code_Name + '=',Tstr) +
- '/C=' + Parse_Str('C' + Code_Name + '=',Tstr);
- END;
- END;
-
- EXIT:
- END_MACRO;
-
- $MACRO NOTINC TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: NOTINC
-
- Description: Puts up the message that a module is not included.
-
- Parameters:
- /X= The upper left column coordinate
- /Y= The upper left row coordinate
- /T= The name of the option
- /H= The help index string, if help is to be enabled
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- def_int(x,y);
- X := parse_int('/X=', mparm_str);
- Y := parse_int('/Y=', mparm_str);
- if x = 0 then
- x := 12;
- end;
- if y = 0 then
- y := 8;
- end;
- If (x + 55) > screen_width then
- x := screen_width - 55;
- end;
- If (y + 9) > (screen_length - 1) then
- y := screen_length - 10;
- end;
- put_box(x,y,x + 55,y + 9,0,error_color, caps(parse_str('/T=',mparm_str)) + ' OPTION NOT INCLUDED',true);
- write('Please contact American Cybernetics for information',x+1,y+2,0,error_color);
- write('and availablity of this option.',x+1,y+3,0,error_color);
- write('Call (602) 968-1945.',x+1,y+5,0,error_color);
- if parse_str('/H=',mparm_str) <> '' then
- write('<F1> for more info, any other key to continue...',x+1,y+7,0,error_color);
- else
- write('Press any key to continue...',x+1,y+7,0,error_color);
- end;
- RM('MEERROR^Beeps /C=2');
- again:
- read_key;
- if (key1 = 0) and (key2 = 59) then
- help( parse_str('/H=',mparm_str));
- goto again;
- end;
- kill_box;
- return_int := 100;
- END_MACRO;
-