home *** CD-ROM | disk | FTP | other *** search
- $MACRO_FILE SPELL;
- {*****************************MULTI-EDIT MACRO FILE****************************
-
- Name: SPELL
-
- Description: This is the spell checker macros.
-
- SPELL - The main spell checker menu
- SPELLCHK - The spell checker main interface
- SPLSETF - Retrieves spell checker setup data from file
- SPLSETUP - The spell checker setup interface
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
-
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: SPELL
-
- Description: This is the spell checker main menu.
-
- Parameters:
- /X= X coordinate for menu box
- /Y= Y coordinate for menu box
- /BC= Amount of boxes the menu system currently has
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- $MACRO SPELL;
- def_str( gstr[20] );
- refresh := false;
- gstr := '!SPELL!_';
- Set_Global_Str(gstr+'1','/H=SPELL^*/S=2/N=Check from cursor position/M=SPELLCHK /T=0');
- Set_Global_Str(gstr+'2','/S=2/N=Look up word under cursor/M=SPELLCHK /T=1');
- Set_Global_Str(gstr+'3','/S=2/N=check marked Block/M=SPELLCHK /T=2');
- Set_Global_Str(gstr+'4','/S=2/N=check current Page/M=SPELLCHK /T=3');
- Set_Global_Str(gstr+'5','/N=Setup spell check/M=SPLSETUP');
- Set_Global_Str(gstr+'6','/S=2/N=spell check text in Quotes/M=SpellCheckSource');
- RM('USERIN^SUBMENU /#=6/S=' + global_str(gstr+'0') + '/L=SPELL CHECK/G=' + gstr +
- '/X=' + parse_str('/X=', mparm_str) +
- '/Y=' + parse_str('/Y=', mparm_str) +
- '/BC=' + parse_str('/BC=', mparm_str)
- );
-
- END_MACRO;
-
-
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: SPELLCHK
-
- Description: Performs an actual spellcheck.
-
- Parameters: /T=nn Spell check type.
- 0 = Check document from cursor position
- 1 = Lookup word under cursor
- 2 = Check block
- 3 = Check page
- /NCD=1 Do NOT CLOSE DICTIONARIES when upon completion.
- /CD=1 Just close the dictionaries and exit.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- $MACRO SPELLCHK;
- def_str( orig_word[80], tstr[80], tstr2[80], lstr, prev_word[80],
- forced_match[2], lchar[1], word_chars[128] );
- def_str( ignore_word[40], ignore_char[40] );
- def_int( tbc, need_l,need_w,x,y,ee, jy, jz, jx, tc,tc2, box_offset, menu_start,
- aux_window, aux1_window, aux2_window, work_window, cur_dic, list_window,
- ignore_window, t_word_wrap ,T_Insert_Mode);
- def_int( min_word_size, op_type, word_count, word_result, screen_stat, tr );
- def_int( common_result );
- def_char( tchar, pchar );
-
- t_word_wrap := wrap_stat;
- T_Insert_Mode := Insert_Mode;
- Insert_Mode := true;
- work_window := window_id;
- aux_window := 0;
- aux1_window := GLOBAL_INT('SPELL_AUX1_WINDOW');
- aux2_window := GLOBAL_INT('SPELL_AUX2_WINDOW');
- ignore_window := GLOBAL_INT('SPELL_IGNORE_WINDOW');
- list_window := GLOBAL_INT('SPELL_LIST_WINDOW');
-
- IF parse_int('/CD=', mparm_str) = 1 THEN
- goto close_dictionaries;
- END;
-
- if global_str('SPELL_MAIN_DIC') = '' THEN
- RM('splsetf');
- end;
-
- op_type := parse_int('/T=', mparm_str);
- if op_type = 1 then
- mark_pos;
- end;
- if op_type = 2 then
- if block_stat = 0 then
- make_message('No block marked.');
- goto exit;
- end;
- block_end;
- goto_line( block_line1 );
- goto_col( block_col1 );
- redraw;
- end;
- if op_type = 3 then
- reg_exp_stat := false;
- if search_bwd( page_str, 0 ) = 0 then
- tof;
- end;
- reg_exp_stat := true;
- pchar := copy(page_str, 1, 1 );
- end;
- tstr := global_str('SPELL_PARMS');
- min_word_size := parse_int('/WS=',tstr) - 1;
- screen_stat := parse_int('/SCRN=',tstr);
- wrap_stat := (parse_int('/WW=',tstr) and wrap_stat);
-
- tbc := box_count;
-
-
- word_chars := global_str('SPELL_CHARS');
- ignore_word := global_str('SPELL_IGNORE_W');
- ignore_char := global_str('SPELL_IGNORE_C');
-
- orig_word := global_str('SPELL_COMMON_DIC');
- if get_path(orig_word) = '' then
- orig_word := me_path + orig_word;
- end;
-
- if spell_open_dic(orig_word, 4, 1, 0 ) = false then
- end;
-
- orig_word := global_str('SPELL_MAIN_DIC');
- if get_path(orig_word) = '' then
- orig_word := me_path + orig_word;
- end;
-
-
- if spell_open_dic(orig_word, 1, 1, 500 ) = false then
- make_message('Cannot open main dictionary "' + global_str('SPELL_MAIN_DIC') + '".');
- word_result := -1;
- goto exit;
- end;
-
- orig_word := global_str('SPELL_AUX1_DIC');
- if get_path(orig_word) = '' then
- orig_word := me_path + orig_word;
- end;
- if spell_open_dic( orig_word, 2, 0, 500 ) = false then
- end;
-
- orig_word := global_str('SPELL_AUX2_DIC');
- if get_path(orig_word) = '' then
- orig_word := me_path + orig_word;
- end;
- if spell_open_dic( orig_word, 3, 0, 500 ) = false then
- end;
-
- refresh := false;
- {go to start of first word}
-
- while (xpos(cur_char,'|255 |9',1) <> 0) and (c_col > 1) do
- left;
- end;
-
- while (xpos(cur_char, '|255() ''"|9[]{}+\-||=*&^%$#@!~`><,.:;?/', 1) = 0) do
- if (c_col = 1) then
- goto loop_start;
- end;
- left;
- end;
- right;
-
- loop_start:
- tstr := '';
- call spell_message;
- word_count := 0;
- loop:
- if op_type > 0 then
- if op_type = 1 then
- if word_count > 0 then
- goto exit;
- end;
- else
- {restrict to block}
- if op_type = 2 then
- if c_line >= block_line2 then
- if c_line > block_line2 then
- goto check_complete;
- end;
- if block_stat = 3 then
- if c_col > block_col2 then
- goto check_complete;
- end;
- end;
- end;
- if block_stat = 2 then
- if c_col > block_col2 then
- down;
- goto_col( block_col1 );
- goto loop;
- end;
- end;
- end;
- end;
- end;
- prev_word := tstr;
-
-
- if check_key then
- if key1 = 27 then
- goto abort_check;
- end;
- end;
-
- tc := c_col;
- tchar := lower(cur_char);
- jx := ascii(tchar);
- if (jx > 96) and (jx < 123) then
- ++word_count;
- refresh := screen_stat;
- orig_word := get_word_in( word_chars );
- try_again:
-
- {Ignore any word with an underscore in it.}
- jz := xpos('_', orig_word, 2);
- if jz <> 0 then
- tstr := orig_word;
- goto do_loop2;
- end;
-
- {deal with apostrophes}
- jz := xpos('''', orig_word, 2);
- if jz <> 0 then
- if (svl(orig_word) = (jz + 1)) then
- if lower(str_char(orig_word, jz + 1)) = 's' then
- orig_word := str_del( orig_word, jz, 2 );
- end;
- else
- if svl( orig_word ) = jz then
- orig_word := str_del( orig_word, jz, 1 );
- end;
- end;
- end;
- tc2 := c_col;
- tstr := lower(orig_word);
- word_result := true;
- jx := svl(tstr);
- if jx > min_word_size then
- {If the wordlength is less than 9 then check the common words
- dictionary}
- if jx < 9 then
- common_result := spell_lookup_word( tstr,4 );
- else
- common_result := 0;
- end;
- if common_result = 0 then
- if spell_lookup_word( tstr, 1 ) = 0 then
- if spell_lookup_word( tstr, 2 ) = 0 then
- if spell_lookup_word( tstr, 3 ) = 0 then
- if switch_win_id( ignore_window ) then
- tof;
- if search_fwd('%' + tstr + '@||',0) then
- goto_col( svl(tstr) + 2);
- return_str := get_word(' ');
- if switch_win_id( work_window ) then end;
- if return_str <> '' then
- goto_col(tc);
- call replace_word;
- end;
- goto do_loop;
- end;
- if switch_win_id( work_window ) then end;
- end;
- refresh := true;
- goto_col(c_col);
- word_result := false;
- jx := 0;
- goto_col(tc);
- goto_v_col( v_col );
- box_offset := 0;
- menu_start := 1;
- draw_attr(wherex, wherey, h_color or $80, svl(tstr));
- need_l := 11;
- need_w := svl(tstr) + 17;
- if need_w < 25 then
- need_w := 25;
- end;
- call calc_xy;
-
- refresh := false;
- menu_again:
- set_global_str('SPELL1', '/H=SPELL^MSPLDUNKWN/N=Ignore');
- set_global_str('SPELL2', '/N=Edit word');
- set_global_str('SPELL3', '/N=Suggest spellings');
- set_global_str('SPELL4', '/N=Add to aux. dictionary 1');
- set_global_str('SPELL5', '/N=add to aux. dictionary 2');
- set_global_str('SPELL6', '/N=iGnore for rest of check');
- set_global_str('SPELL7', '/N=Quit spell check(<ESC>)');
- RM('USERIN^SUBMENU /GCLR=1/G=SPELL/#=7/X=' + str(x + box_offset) +
- '/Y=' + str(y + box_offset) + '/S=' + str(menu_start) +
- '/B=' + str( box_offset ) +
- '/L="' + tstr + '" NOT FOUND');
- menu_start := return_int;
- box_offset := 1;
- if (return_int < 1) or (return_int = 7) then
- while box_count > tbc do
- kill_box;
- end;
- goto abort_check;
- end;
- if return_int = 1 then
- goto_col(tc2);
- kill_box;
- goto do_loop;
- end;
- if return_int = 2 then {edit the word}
- return_str := orig_word;
- make_message('Press <ENTER> to replace word with edited word, <ESC> to abort edit.');
- RM('USERIN^USERSTR /X=' + str(x + 1) + '/Y=' + str(y + 6) +
- '/L=80/B=1/BL=EDIT WORD/W=40/BL=40/H=SPELL^MSPLDUNKWN');
- make_message('');
- if return_int < 1 then
- goto menu_again;
- end;
- call check_replace;
- if tr < 1 then
- goto menu_again;
- end;
- kill_box;
- word_result := 2;
- call replace_word2;
- if tr = 2 then
- tstr := lower(orig_word) + '||' + lower(return_str);
- call add_word_to_ignore;
- end;
- goto do_loop;
- end;
- if return_int = 3 then
- goto possible_spellings;
- end;
- if return_int = 4 then
- goto_col(tc2);
- kill_box;
- aux_window := aux1_window;
- cur_dic := 2;
- lstr := global_str('SPELL_AUX1_DIC');
- call add_word_to_aux;
- aux1_window := aux_window;
- SET_GLOBAL_INT('SPELL_AUX1_WINDOW', aux1_window);
- goto do_loop;
- end;
- if return_int = 5 then
- goto_col(tc2);
- kill_box;
- aux_window := aux2_window;
- lstr := global_str('SPELL_AUX2_DIC');
- cur_dic := 3;
- call add_word_to_aux;
- aux2_window := aux_window;
- SET_GLOBAL_INT('SPELL_AUX2_WINDOW', aux2_window);
- goto do_loop;
- end;
- if return_int = 6 then
- goto_col(tc2);
- kill_box;
- tstr := tstr + '||';
- call add_word_to_ignore;
- goto do_loop;
- end;
- do_loop:
- refresh := true;
- redraw;
- call spell_message;
- refresh := false;
- end;
- end;
- end;
- end;
- end;
- no_check:
- refresh := false;
-
- {process double word}
- if prev_word = tstr then
- refresh := true;
- goto_col(c_col);
- goto_col(tc);
- draw_attr(wherex, wherey, h_color or $80, svl(tstr));
- need_l := 7;
- need_w := svl(tstr) + 18;
- if need_w < 25 then
- need_w := 25;
- end;
- call calc_xy;
- RM('USERIN^XMENU /T=1/B=1/X=' + str(x) + '/Y=' + str(y) +
- '/L="' + tstr + '" - DOUBLE WORDS"/M=Ignore(SPELL^DBLWDS)Delete()Quit spell check((<ESC>)()');
- if (return_int < 1) or (return_int = 5) then
- goto abort_check;
- end;
- if (return_int = 2) then
- if c_col > 1 then
- left;
- if cur_char = ' ' then
- del_char;
- else
- right;
- end;
- end;
- del_chars( svl(tstr) );
- else
- goto_col(tc2);
- end;
- refresh := true;
- redraw;
- refresh := false;
- call spell_message;
- end;
- else
- if op_type = 3 then
- if tchar = pchar then
- if word_count > 0 then
- if copy(get_line, c_col, length(page_str)) = page_str then
- goto check_complete;
- end;
- end;
- end;
- end;
-
- tstr := tchar;
- right;
- if xpos(tchar, ignore_word, 1) then
- tstr := lower(get_word_in(word_chars ));
- tstr := '';
- else
- if xpos(tchar, ignore_char, 1) then
- right;
- end;
- end;
- end;
-
- do_loop2:
- forward_till_not(' |9|255');
- eolagain:
- if at_eol then
- refresh := screen_stat;
- down;
- first_word;
- if at_eof then
- goto check_complete;
- end;
- if (at_eol) then
- tstr := '';
- goto eolagain;
- end;
- if screen_stat = 0 then
- put_line_num(c_line);
- end;
- refresh := false;
- end;
- goto loop;
-
-
- spell_message:
- make_message('Checking... Press <ESC> to abort.');
- ret;
-
- calc_xy:
- x := (wherex + (svl(tstr) /2)) - (need_w / 2);
- if (x + need_w + 2) > screen_width then
- x := screen_width - ( need_w + 2 );
- end;
- if x < 1 then
- x := 1;
- end;
- y := wherey - need_l;
- if y < 3 then
- y := wherey + 2;
- if y > (screen_length - need_l) then
- y := 3;
- end;
- end;
- ret;
-
- add_word_to_ignore:
- aux_window := ignore_window;
- lstr := '';
- cur_dic := 100;
- call add_word_to_aux;
- ignore_window := aux_window;
- SET_GLOBAL_INT('SPELL_IGNORE_WINDOW', ignore_window);
- ret;
-
- possible_spellings:
- make_message('Scanning...');
- lstr := '';
- jx := 0;
- refresh := false;
- if not( switch_win_id( list_window ) ) then
- switch_window( window_count );
- create_window;
- list_window := window_id;
- SET_GLOBAL_INT('SPELL_LIST_WINDOW',list_window);
- else
- erase_window;
- end;
-
- jz := 1;
- jy := 1;
- call lookup_loop;
-
- jz := 0;
- jy := 2;
- call lookup_loop;
-
-
- tchar := copy(tstr,1,1);
- lstr := global_str('SPELL_PHONIC_CHARS');
- jz := xpos(tchar + '=', lstr,1 );
- IF jz <> 0 THEN
- set_global_str('@@@TSTR@@@', tstr );
- jy := xpos(',',lstr,jz);
- IF jy = 0 THEN
- jy := svl(lstr);
- END;
- forced_match := copy(lstr, jz + 2, jy - jz - 2);
- tstr := forced_match + str_del(tstr,1,1);
- jz := 1;
- jy := 1;
- call lookup_loop2;
- tstr := global_str('@@@TSTR@@@' );
- set_global_str('@@@TSTR@@@', '' );
- END;
-
-
- if jx = 0 then
- make_message('No choices found.');
- if switch_win_id( work_window ) then end;
- goto menu_again;
- end;
-
- tof;
- make_message('Select word and press <ENTER> to replace, or <ESC> to return to menu.');
- return_str := '';
- RM('USERIN^DVMENU /WIN=' + str( cur_window ) + '/X=' + str(x + 1) + '/Y=' + str(y+1) +
- '/T=POSSIBLE SPELLINGS/H=SPELL^MSPLDUNKWN%Suggest/B=1/K=1/I=%/#=' + str(jx));
- if switch_win_id( work_window ) then end;
- if return_int = 0 then
- goto menu_again;
- end;
- if return_int = 1 then
- call check_replace;
- if tr < 1 then
- goto menu_again;
- end;
- kill_box;
- call replace_word;
- word_result := 2;
- if tr = 2 then
- tstr := lower(orig_word) + '||' + lower(return_str);
- call add_word_to_ignore;
- end;
- goto do_loop;
- end;
- kill_box;
- goto do_loop;
-
-
- {jz = 1, start at first char of word}
- {jz = 0, start at top of dictionary}
- {tstr = word to find}
- {jy = dictionary to search}
- lookup_loop:
- IF jz THEN
- lchar := copy(tstr,1,1);
- ELSE
- lchar := '';
- END;
- if spell_lookup_word( lchar, jy ) then
- loop2:
- tstr2 := spell_next_match( tstr, jy );
- if svl(tstr2) <> 0 then
- call add_word_to_file;
- ++jx;
- goto loop2;
- end;
- end;
- RET;
-
- {jz = 1, start at first char of word}
- {jz = 0, start at top of dictionary}
- {tstr = word to find}
- {jy = dictionary to search}
- lookup_loop2:
- IF jz THEN
- lchar := copy(tstr,1,1);
- ELSE
- lchar := '';
- END;
- if spell_lookup_word( lchar, jy ) then
- loop2xx:
- tstr2 := spell_next_match( tstr, jy );
- if (svl(tstr2) <> 0) then
-
- if (copy(tstr2,1,svl(forced_match)) = forced_match) then
- call add_word_to_file;
- ++jx;
- end;
- goto loop2xx;
- end;
- end;
- RET;
-
-
- check_replace:
- IF op_type = 1 THEN
- tr := 1;
- RET;
- END;
- RM('USERIN^XMENU /X=' + str(x+1) + '/Y=' + str(y + 3) +
- '/B=1/L=REPLACE WORD (<ESC> to abort)/M=Just this occurrence(SPELL^MSPLDUNKWN)All occurrences()');
- tr := return_int;
- ret;
-
- replace_word:
- def_int( rx );
-
- rx := 0;
- caps_loop:
- if rx < svl(orig_word) then
- if (str_char(orig_word,rx + 1) >= 'A') and (str_char(orig_word,rx + 1) <= 'Z') then
- ++rx;
- goto caps_loop;
- end;
- end;
-
- if rx = svl(orig_word) then
- return_str := caps(return_str);
- else
- if (str_char(orig_word,1) >= 'A') and (str_char(orig_word,1) <= 'Z') then
- return_str := caps(copy(return_str,1,1)) + str_del(return_str,1,1);
- end;
- end;
- replace_word2:
- push_undo;
- del_chars( svl(tstr) );
- Insert_Mode := True;
- text(return_str);
- if wrap_stat then
- word_wrap_line( FALSE, TRUE );
- end;
- pop_undo;
- tstr := return_str;
- ret;
-
-
- {aux_window = window_number}
- {lstr = file_name}
- add_word_to_aux:
- refresh := false;
- undo_stat := false;
- working;
- if cur_dic < 100 then
- ee := spell_close_dic( cur_dic );
- end;
- if switch_win_id( aux_window ) = 0 then
- switch_window(window_count);
- create_window;
- window_attr := 1;
- if lstr <> '' then
- if get_path(lstr) = '' then
- lstr := me_path + lstr;
- end;
- load_file( lstr );
- if error_level <> 0 then
- error_level := 0;
- file_name := lstr;
- end;
- end;
- aux_window := window_id;
- end;
- tstr2 := tstr;
- call add_word_to_file;
- if cur_dic < 100 then
- save_file;
- end;
- if switch_win_id( work_window ) then
- end;
- if cur_dic < 100 then
- ee := spell_open_dic( lstr, cur_dic, 1, 2000 );
- end;
- undo_stat := true;
- ret;
-
-
- {assumes current file}
- {tstr2 is the word to insert}
- {puts word in file in alphebetical order}
- {eliminates duplicates}
- add_word_to_file:
- tof;
- reg_exp_stat := true;
- if search_fwd('%' + copy(tstr2,1,1), 0) then
- end;
- while not(at_eof) and (get_line < tstr2) do
- down;
- end;
- goto_col(1);
- if get_line <> tstr2 then
- if not(at_eof) then
- cr;
- up;
- end;
- put_line(tstr2);
- end;
- ret;
-
-
- abort_check:
- make_message('Spell check aborted, ' + str(word_count) + ' words checked.');
- delay(200);
- if check_key then
- if key1 <> 27 then
- push_key(key1,key2);
- end;
- end;
- goto exit;
-
-
- check_complete:
- make_message('Spell check complete, ' + str(word_count) + ' words checked.');
-
- exit:
- if op_type = 1 then
- if word_result = 1 then
- make_message('Word spelled correctly.');
- elsif word_result = 2 then
- make_message('Word replaced');
- elsif word_result = -1 then
- else
- make_message('');
- end;
- jx := messages;
- messages := false;
- goto_mark;
- messages := jx;
- end;
-
- refresh := false;
-
- {close all dictionaries}
- IF parse_int('/NCD=',mparm_str) = 1 THEN
- goto no_close_dicts;
- END;
- Close_Dictionaries:
- if switch_win_id( list_window ) then
- delete_window;
- SET_GLOBAL_INT('SPELL_LIST_WINDOW', 0);
- end;
- if switch_win_id( aux1_window ) then
- delete_window;
- SET_GLOBAL_INT('SPELL_AUX2_WINDOW', 0);
- end;
- if switch_win_id( aux2_window ) then
- delete_window;
- SET_GLOBAL_INT('SPELL_AUX2_WINDOW', 0);
- end;
- if switch_win_id( ignore_window ) then
- delete_window;
- SET_GLOBAL_INT('SPELL_IGNORE_WINDOW',0);
- end;
- ee := spell_close_dic( 1 );
- ee := spell_close_dic( 2 );
- ee := spell_close_dic( 3 );
- ee := spell_close_dic( 4 );
- No_Close_Dicts:
- if switch_win_id( work_window ) then
- end;
- wrap_stat := t_word_wrap;
- return_int := 100;
- Insert_Mode := T_Insert_Mode;
- redraw;
- END_MACRO;
-
-
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: SPLSETF
-
- Description: Retrieves spell check setup parameters from disk.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- $MACRO SPLSETF;
- def_int( t2 );
- refresh := false;
- error_level := 0;
- t2 := window_id;
- create_window;
- if error_level = 0 then
- return_str := 'SPELLSET.ME';
- RM('MakeUserPath /DF=1');
- load_file( return_str );
- update_status_line;
- set_global_str('SPELL_CHARS', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_''');
- if error_level = 0 then
- set_global_str( 'SPELL_COMMON_DIC', get_line );
- down;
- set_global_str( 'SPELL_MAIN_DIC', get_line );
- down;
- set_global_str( 'SPELL_AUX1_DIC', get_line );
- down;
- set_global_str( 'SPELL_AUX2_DIC', get_line );
- down;
- set_global_str( 'SPELL_IGNORE_W', get_line );
- down;
- set_global_str( 'SPELL_IGNORE_C', get_line );
- down;
- set_global_str( 'SPELL_PARMS', get_line );
- down;
- if NOT(at_eof) THEN
- set_global_str( 'SPELL_CHARS', get_line );
- END;
- else
- error_level := 0;
- set_global_str( 'SPELL_COMMON_DIC', 'COMMON.DIC' );
- set_global_str( 'SPELL_MAIN_DIC', 'ME.DIC' );
- set_global_str( 'SPELL_AUX1_DIC', 'AUXDIC.TXT' );
- set_global_str( 'SPELL_AUX2_DIC', 'AUXDIC2.TXT' );
- set_global_str( 'SPELL_IGNORE_W', '.@<' );
- set_global_str( 'SPELL_IGNORE_C', '^' );
- set_global_str( 'SPELL_PARMS', '/WS=1/SCRN=1/WW=0' );
- end;
- delete_window;
- else
- RM('MEERROR');
- end;
- if switch_win_id(t2) then
- end;
- update_status_line;
- END_MACRO;
-
-
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: SpellCheckSource
-
- Description: Goes through a source file, from the current cursor position
- and spell checks all text that is in between single, or double quotes.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- $MACRO SpellCheckSource;
- reg_exp_stat := TRUE;
- key1 := 0;
- WHILE Search_Fwd('[''"]',0) DO
- if key1 = 27 THEN
- goto done;
- END;
- RIGHT;
- Str_Block_Begin;
- IF NOT(search_fwd(found_str,0)) THEN
- goto done;
- END;
- block_End;
- Goto_Line( block_line1 );
- goto_col( block_col1 );
- refresh := TRUE;
- redraw;
- RM('SPELLCHK /T=2/NCD=1');
- goto_line(block_line2);
- goto_col(block_col2 + 2);
- reg_exp_stat := TRUE;
- END;
- DONE:
- RM('SPELLCHK /CD=1');
- exit:
- END_MACRO;
-
-
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: SPLSETUP
-
- Description: A setup interface for the spell checker.
-
- Parameters:
- /X= The upper left corner column coordinate
- /Y= The upper left corner row coordinate
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- $MACRO SPLSETUP;
- def_int( x,y, tw );
-
- refresh := false;
- tw := window_id;
- y := parse_int('/Y=', mparm_str);
- if y = 0 then
- y := 2;
- end;
- x := parse_int('/X=', mparm_str);
- if x = 0 then
- x := 2;
- end;
- if global_str( 'SPELL_MAIN_DIC' ) = '' then
- RM('splsetf');
- end;
-
- Set_Global_Str('ISTR_1', global_str( 'SPELL_COMMON_DIC' ) );
- Set_Global_Str('IPARM_1','/T=Common words dictionary............./C=1/W=24/ML=80');
- Set_Global_Str('ISTR_2', global_str( 'SPELL_MAIN_DIC' ) );
- Set_Global_Str('IPARM_2','/T=Main dictionary...................../C=1/W=24/ML=80');
- Set_Global_Str('ISTR_3',global_str( 'SPELL_AUX1_DIC' ));
- Set_Global_Str('IPARM_3','/T=Auxilary dictionary 1.............../C=1/W=24/ML=80');
- Set_Global_Str('ISTR_4',global_str( 'SPELL_AUX2_DIC' ));
- Set_Global_Str('IPARM_4','/T=Auxilary dictionary 2.............../C=1/W=24/ML=80');
- Set_Global_Str('ISTR_5',global_str( 'SPELL_IGNORE_W' ));
- Set_Global_Str('IPARM_5','/T=Ignore word after these chars......./C=1/W=20');
- Set_Global_Str('ISTR_6',global_str( 'SPELL_IGNORE_C' ));
- Set_Global_Str('IPARM_6','/T=Ignore character after these chars../C=1/W=20');
-
- Set_Global_Int('IINT_7',parse_int('/WS=', global_str( 'SPELL_PARMS' )));
- Set_Global_Str('IPARM_7','/T=Minimum word size.................../C=1/W=2/TP=1');
- Set_Global_Int('IINT_8',parse_int('/SCRN=', global_str( 'SPELL_PARMS' )));
- Set_Global_Str('ISTR_8','/T=YES/F=NO');
- Set_Global_Str('IPARM_8','/T=Screen updating...................../C=1/W=3/TP=5');
- Set_Global_Int('IINT_9',parse_int('/WW=', global_str( 'SPELL_PARMS' )));
- Set_Global_Str('ISTR_9','/T=YES/F=NO');
- Set_Global_Str('IPARM_9','/T=Reformat if Word Wrap is on........./C=1/W=3/TP=5');
- Set_Global_Str('ISTR_10',global_str( 'SPELL_CHARS' ));
- Set_Global_Str('IPARM_10','/T=Valid word characters/C=1/W=40/ML=128');
-
- RM('UserIn^Data_In /H=SPELL^SETUPSPL/S=1/A=2/#=10/X=' + str(x) + '/T=SPELL CHECK SETUP/Y=' + str(y));
-
- Set_Global_Str('SPELL_COMMON_DIC', global_str('ISTR_1'));
- Set_Global_Str('SPELL_MAIN_DIC', global_str('ISTR_2'));
- Set_Global_Str('SPELL_AUX1_DIC', global_str('ISTR_3'));
- Set_Global_Str('SPELL_AUX2_DIC', global_str('ISTR_4'));
- Set_Global_Str('SPELL_IGNORE_W', global_str('ISTR_5'));
- Set_Global_Str('SPELL_IGNORE_C', global_str('ISTR_6'));
- Set_Global_Str('SPELL_CHARS', global_str('ISTR_10'));
- Set_Global_Str('SPELL_PARMS', '/WS=' + str(global_int('IINT_7')) + '/SCRN=' + str(global_int('IINT_8'))
- + '/WW=' + str(global_int('IINT_9'))
- );
-
- {now save the configuration}
- error_level := 0;
- create_window;
- if error_level = 0 then
- return_str := 'SPELLSET.ME';
- RM('MakeUserPath');
- file_name := return_str;
- put_line( global_str('SPELL_COMMON_DIC') );
- down;
- put_line( global_str('SPELL_MAIN_DIC') );
- down;
- put_line( global_str('SPELL_AUX1_DIC') );
- down;
- put_line( global_str('SPELL_AUX2_DIC') );
- down;
- put_line( global_str('SPELL_IGNORE_W') );
- down;
- put_line( global_str('SPELL_IGNORE_C') );
- down;
- put_line( global_str('SPELL_PARMS') );
- down;
- put_line( global_str('SPELL_CHARS') );
- down;
- save_file;
- delete_window;
- else
- RM('MEERROR');
- end;
- if switch_win_id(tw) then
- end;
- update_status_line;
-
- return_int := 0;
- END_MACRO;
-
-
-