home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / ME494-6.ZIP / SRC / TEXT.SRC < prev    next >
Encoding:
Text File  |  1990-05-03  |  20.6 KB  |  902 lines

  1. $MACRO_FILE TEXT;
  2. {***************************MULTI-EDIT MACRO FILE******************************
  3.  
  4. CHNGCASE                    - Changes the case of a line, word, or block
  5. TEXTSORT                    - Sorts lines of text
  6. CENTER                        - Centers a line
  7. OPENLN                        - Insert a blank line while in overwrite mode
  8. REFORMAT                    - Reformats a paragraph
  9. JUSTIFY                        - Justifies a paragraph
  10. UNJUSTIF                    - Unjustifies a paragraph
  11. RULER                            - Displays a character ruler at the cursor position
  12. END_OF_PARAGRAPH    - Finds the end of the current paragraph
  13. NEXT_PARAGRAPH        - Finds the beginning of the next paragraph
  14. MARKPOS                        - Mark a position using the stack bookmarks
  15. GOTOMARK                    - Return to a mark on the stack
  16. SET_MARK                    - Mark a position using random marks
  17. GET_MARK                    - Return to a random mark
  18.  
  19.                              (C) Copyright 1989 by American Cybernetics, Inc.
  20. ******************************************************************************}
  21.  
  22. $MACRO CHNGCASE TRANS;
  23. {*******************************MULTI-EDIT MACRO******************************
  24.  
  25. Name:  CHNGCASE
  26.  
  27. Description:  Changes the case of a block of text.
  28.  
  29. Parameters:  /U=1            Uppercase
  30.                              =0            Lowercase
  31.                          /T=0            Line
  32.                              =1            Word
  33.                              =2            Block
  34.  
  35.                              (C) Copyright 1989 by American Cybernetics, Inc.
  36. ******************************************************************************}
  37.     def_int( jx, tc, ti, casetype, blocktype, tb1, tbs, tb2, tbl1, tbl2, tbc1, tbc2 );
  38.     def_str( tstr );
  39.  
  40.     push_undo;
  41.     refresh := false;
  42.     ti := insert_mode;
  43.     insert_mode := true;
  44.     casetype := parse_int('/U=', mparm_str);
  45.     blocktype := parse_int('/T=', mparm_str);
  46.  
  47.     if blocktype = 0 then
  48.         if casetype then
  49.             put_line( caps(get_line));
  50.         else
  51.             put_line( lower(get_line));
  52.         end;
  53.     end;
  54.     if blocktype = 1 then
  55.         if not(at_eol) and (xpos(cur_char,word_delimits,1) <> 0) then
  56.             word_right;
  57.         else
  58.             if c_col > 1 then
  59.                 left;
  60.                 if xpos(cur_char,word_delimits,1) then
  61.                     right;
  62.                 else
  63.                     right;
  64.                     word_left;
  65.                 end;
  66.             end;
  67.         end;
  68.         tc := c_col;
  69.         tstr := get_word(word_delimits);
  70.         if casetype then
  71.             tstr := caps(tstr);
  72.         else
  73.             tstr := lower(tstr);
  74.         end;
  75.  
  76.         goto_col(tc);
  77.         del_chars( svl(tstr) );
  78.         text( tstr );
  79.     end;
  80.     if (block_stat <> 0) and (blocktype = 2) then
  81.         block_end;
  82.         tbl1 := block_line1; tbl2 := block_line2;
  83.         tbc1 := block_col1; tbc2 := block_col2;
  84.         tbs := block_stat;
  85.         mark_pos;
  86.         jx := block_line1;
  87.         while jx <= tbl2 do
  88.             goto_line(jx);
  89.             if tbs = 1 then
  90.                 if casetype then
  91.                     put_line( caps(get_line));
  92.                 else
  93.                     put_line( lower(get_line));
  94.                 end;
  95.             end;
  96.             if tbs = 2 then
  97.                 goto_col(tbc1);
  98.                 tstr := copy(get_line, tbc1, tbc2 - tbc1 + 1);
  99.                 del_chars( svl(tstr) );
  100.                 if casetype then
  101.                     tstr := caps(tstr);
  102.                 else
  103.                     tstr := lower(tstr);
  104.                 end;
  105.                 text( tstr );
  106.             end;
  107.             if tbs = 3 then
  108.                 goto_col(1);
  109.                 tb1 := 1;
  110.                 tstr := get_line;
  111.                 tb2 := svl( tstr );
  112.                 if jx = tbl1 then
  113.                      goto_col(tbc1);
  114.                      tb1 := tbc1;
  115.                 end;
  116.                 if jx = tbl2 then
  117.                     tb2 := tbc2;
  118.                 end;
  119.                 del_chars( tb2 - tb1 + 1);
  120.                 tstr := copy( tstr, tb1, tb2 - tb1 + 1);
  121.                 if casetype then
  122.                     tstr := caps(tstr);
  123.                 else
  124.                     tstr := lower(tstr);
  125.                 end;
  126.                 text(tstr);
  127.             end;
  128.             ++jx;
  129.             down;
  130.         end;
  131.         if tbs = 3 then
  132.             goto_line(tbl1);
  133.             goto_col(tbc1);
  134.             str_block_begin;
  135.             goto_line(tbl2);
  136.             goto_col(tbc2 + 1);
  137.             block_end;
  138.         end;
  139.         goto_mark;
  140.     end;
  141.     insert_mode := ti;
  142.     pop_undo;
  143.     redraw;
  144. END_MACRO;
  145.  
  146. $MACRO TEXTSORT TRANS;
  147. {*******************************MULTI-EDIT MACRO******************************
  148.  
  149. Name:    TextSort
  150.  
  151. Description:    Sorts lines of text.
  152.  
  153. Parameters:        /C=nn            Starting column of sort field.
  154.                             /L=nn            # of characters in sort field.
  155.                             /CASE            Ignore case of field.
  156.                             /D                Sort in descending order.
  157.                             /B                Sort the marked line block.
  158.  
  159.                              (C) Copyright 1989 by American Cybernetics, Inc.
  160. ******************************************************************************}
  161.  
  162.         Def_Int( IX, SX, SL,SC, NC, C, L, Caps_On, Descending, jx, Sort_Mode, old_block_stat,tw );
  163.         Def_Int( count );
  164.         Def_Str( DP1, DP2, DX1, DX2 );
  165.         def_char( tc, dc );
  166.  
  167.         push_undo;
  168.         tw := wrap_stat;
  169.         wrap_stat := false;
  170.         insert_mode := true;
  171.         refresh := false;
  172.         working;
  173.         sl := C_line;
  174.         Sc := C_Col;
  175.         old_block_stat := 0;
  176.         goto_col(1);
  177.         set_indent_level;
  178.         EOF;
  179.         NC := C_Line;
  180.         TOF;
  181.         sx := 1;
  182.         count := 0;
  183.         Descending := xpos( '/D', MParm_Str, 1 ) <> 0;
  184.         Caps_On := Xpos( '/CASE', MParm_Str, 1 ) <> 0;
  185.         c := parse_int( '/C=', MParm_Str );
  186.         l := parse_int( '/L=', MParm_Str );
  187.         if c = 0 then
  188.             c := 1;
  189.         end;
  190.         if l = 0 then
  191.             l := 254;
  192.         end;
  193.  
  194.         if xpos( '/B', MParm_Str, 1 ) <> 0 then
  195.             if Block_Stat <> 1 THEN
  196.                 Make_Message( 'No line block marked.');
  197.                 goto exit;
  198.             end;
  199.             old_block_stat := block_stat;
  200.             sx := block_line1;
  201.             nc := block_line2;
  202.             block_off;
  203.         end;
  204.         sl := sx;
  205.  
  206.         sort_mode := ((nc - sx) > 100);
  207.  
  208.         Make_Message( 'Sorting...' );
  209.  
  210.         { We're going to do this with 2 different loops, depending on the
  211.             options, for speed's sake }
  212.  
  213.  
  214.         if sort_mode then
  215.             jx := 0;
  216.             while jx < 254 do
  217.                 ++jx;
  218.                 set_global_int( char(jx) + 'SORT', sx );
  219.             end;
  220.         end;
  221.  
  222.         If Descending then
  223.             goto DESCEND;
  224.         end;
  225.  
  226. ASCEND:
  227.         while sx < nc do
  228.             ++sx;
  229.             put_line_num(sx);
  230.             GOTO_LINE(SX);
  231.             dp1 := Get_Line;
  232.             dx1 := (Copy( dp1, c, l ));
  233.             If Caps_On then
  234.                 dx1 := caps(dx1);
  235.             end;
  236.             del_line;
  237.             if sort_mode then
  238.                 dc := str_char(dx1,1);
  239.                 ix := global_int( dc + 'SORT' );
  240.             else
  241.                 ix := sl;
  242.             end;
  243.             while ix < sx do
  244.                 goto_line(ix);
  245.                 dx2 := (Copy( get_line, c, l ));
  246.                 If Caps_On then
  247.                     dx2 := caps(dx2);
  248.                 end;
  249.                 If ( dx1 < dx2 ) then
  250.      do_insert2:
  251.                     goto_col(1);
  252.                     cr;
  253.                     up;
  254.                     put_line(dp1);
  255.                     ++count;
  256.                     IF count > 99 THEN
  257.                         pop_undo;
  258.                         push_undo;
  259.                         count := 0;
  260.                     END;
  261.                     if sort_mode then
  262.                         up;
  263.                         goto_col(c);
  264.                         tc := cur_char;
  265.                         if caps_on then
  266.                             tc := caps(tc);
  267.                         end;
  268.                         if tc < dc then
  269.                             set_global_int( dc + 'SORT', c_line );
  270.                         end;
  271.                     end;
  272.                     goto ascend;
  273.                 END;
  274.                 ++ix;
  275.             END;
  276.             down;
  277.             goto do_insert2;
  278.      loopb:
  279.         END;
  280.         goto done;
  281.  
  282. DESCEND:
  283.         while sx < nc do
  284.             ++sx;
  285.             put_line_num(sx);
  286.             GOTO_LINE(SX);
  287.             dp1 := Get_Line;
  288.             dx1 := (Copy( dp1, c, l ));
  289.             If Caps_On then
  290.                 dx1 := caps(dx1);
  291.             end;
  292.             del_line;
  293.             if sort_mode then
  294.                 dc := str_char(dx1,1);
  295.                 ix := global_int( dc + 'SORT' );
  296.             else
  297.                 ix := sl;
  298.             end;
  299.             while ix < sx do
  300.                 goto_line(ix);
  301.                 dx2 := (Copy( get_line, c, l ));
  302.                 If Caps_On then
  303.                     dx2 := caps(dx2);
  304.                 end;
  305.                 If ( dx2 < dx1 ) then
  306.      do_insert3:
  307.                     goto_col(1);
  308.                     cr;
  309.                     up;
  310.                     put_line(dp1);
  311.                     ++count;
  312.                     IF count > 99 THEN
  313.                         pop_undo;
  314.                         push_undo;
  315.                         count := 0;
  316.                     END;
  317.                     if sort_mode then
  318.                         up;
  319.                         tc := cur_char;
  320.                         if caps_on then
  321.                             tc := caps(tc);
  322.                         end;
  323.                         if tc > dc then
  324.                             set_global_int( dc + 'SORT', c_line );
  325.                         end;
  326.                     end;
  327.                     goto descend;
  328.                 END;
  329.                 ++ix;
  330.             END;
  331.             down;
  332.             goto do_insert3;
  333.      loopc:
  334.         END;
  335.         goto done;
  336.  
  337. done:
  338.         Make_Message( 'Sorting complete.' );
  339. exit:
  340.         if sort_mode then
  341.             jx := 0;
  342.             while jx < 254 do
  343.                 ++jx;
  344.                 set_global_int( char(jx) + 'SORT', 0 );
  345.             end;
  346.         end;
  347.         if old_block_stat > 0 then
  348.             goto_line(sl);
  349.             block_begin;
  350.             goto_line(nc);
  351.             block_end;
  352.         end;
  353.         wrap_stat := tw;
  354.         pop_undo;
  355.         refresh := true;
  356.         goto_line( sl );
  357.         Goto_COL(sc);
  358.         redraw;
  359. END_MACRO;
  360.  
  361. $MACRO CENTER TRANS;
  362. {*******************************************************************************
  363.                                                                 MULTI-EDIT MACRO
  364.  
  365. Name: CENTER
  366.  
  367. Description: Centers the line the cursor is on between column 1 and the right
  368.                             margin.
  369.  
  370.  
  371.                              (C) Copyright 1989 by American Cybernetics, Inc.
  372. *******************************************************************************}
  373.  
  374.     Def_Int(jx);
  375.     Def_Str(tstr);
  376.     refresh := false;
  377.     Goto_Col(1);
  378.     Push_Undo;
  379.     Insert_Mode := True;
  380. {Delete leading spaces}
  381.     While NOT(At_EOL) and (XPOS(Cur_Char,'|255|9|32',1) <> 0) Do
  382.         Del_Char;
  383.     End;
  384. {Store line into variable}
  385.     Tstr := Shorten_Str(Get_Line);
  386.     jx := Svl(Tstr);
  387.     If jx > 0 THEN
  388.         jx := (Right_Margin / 2) - (jx / 2);
  389. {Blank out existing line}
  390.         Put_line('');
  391.         Goto_Col(jx);
  392. {Put line at new position.  Works with tabs as spaces, or tabs.}
  393.         Text(TStr);
  394.     END;
  395.     redraw;
  396.     Pop_Undo;
  397. END_MACRO;
  398.  
  399.  
  400. $MACRO OPENLN;
  401. {*******************************************************************************
  402.                                                                 MULTI-EDIT MACRO
  403.  
  404. Name: openln
  405.  
  406. Description: Opens a line below the current line, without moving the cursor.
  407.  
  408.                              (C) Copyright 1989 by American Cybernetics, Inc.
  409. *******************************************************************************}
  410.  
  411.     def_int( temp_ins );
  412.     push_undo;
  413.     temp_ins := insert_mode;
  414.     insert_mode := true;
  415.     Mark_Pos;
  416.     CR;
  417.     Goto_Mark;
  418.     Make_Message('Line opened.');
  419.     insert_mode := temp_ins;
  420.     pop_undo;
  421. END_MACRO;
  422.  
  423. $MACRO REFORMAT TRANS;
  424. {******************************************************************************
  425.                                                                 MULTI-EDIT MACRO
  426.  
  427. Name:    REFORMAT
  428.  
  429. Description: Reformats the current paragraph from the current cursor position
  430.                          down.
  431.                          Parameters:
  432.                                     /RC=n        1 = Restore Cursor position when done
  433.  
  434.                              (C) Copyright 1989 by American Cybernetics, Inc.
  435. ******************************************************************************}
  436.     Push_Undo;
  437.     Word_Wrap_Line( TRUE, FALSE );
  438.     Pop_Undo;
  439.     Make_Message('Paragraph reformatted.');
  440. END_MACRO;
  441.  
  442. $MACRO JUSTIFY TRANS;
  443. {******************************************************************************
  444.                                                                 MULTI-EDIT MACRO
  445.  
  446. Name:    JUSTIFY
  447.  
  448. Description: Justifies the current paragraph from the current cursor position
  449.                          down.
  450.  
  451.                              (C) Copyright 1989 by American Cybernetics, Inc.
  452. ******************************************************************************}
  453.     def_int( jx,jy,rr,jk, ti, tw );
  454.  
  455.     push_undo;
  456.     tw := wrap_stat;
  457.     wrap_stat := false;
  458.     ti := insert_mode;
  459.     insert_mode := true;
  460.     refresh := false;
  461.     mark_pos;
  462.     IF Right_Margin > 132 then
  463.         Goto_Mark;
  464.         Make_Message('Right Margin too big.');
  465.         Goto Exit2;
  466.     END;
  467.     Make_Message('Justifying paragraph...');
  468.     Working;
  469. MAIN_LOOP:
  470.     down;
  471.     goto_col(1);
  472.     if AT_EOL then
  473.         goto EXIT;
  474.     end;
  475.     if Xpos(page_str,get_line,1) then
  476.         goto exit;
  477.     end;
  478.     up;
  479. M2:
  480.     first_word;
  481. {remove trailing spaces}
  482.     put_line( Shorten_Str(Get_Line) );
  483.     jx := 0;
  484.  
  485. {Count existing spaces}
  486. SPACE_LOOP:
  487.     if cur_char = ' ' then
  488.         jx := jx + 1;
  489.     end;
  490.     right;
  491.     if NOT( AT_EOL ) then
  492.         goto space_loop;
  493.     end;
  494.     eol;
  495.     left;
  496.     jy := Right_Margin - c_col;
  497.     IF (jy <= 0) OR (jX <= 0) then
  498.         goto NEXT_LINE;
  499.     end;
  500.     rr := jx / jy;
  501.     first_word;
  502.     jx := 0;
  503.     jk := 0;
  504. {Add in extra spaces until desired line length is reached}
  505.     while NOT( AT_EOL ) do
  506.         if cur_char = ' ' then
  507.             jx := jx + 1;
  508.             if jx >= rr then
  509.                 if jk < jy then
  510.                     jk := jk + 1;
  511.                     text(' ');
  512.                     right;
  513.                 end;
  514.                 jx := 0;
  515.             end;
  516.         end;
  517.         right;
  518.     end;
  519.  
  520. {Repeat until at end of paragraph}
  521.     IF c_col > Right_Margin then
  522.         goto NEXT_LINE;
  523.     END;
  524.     GOTO M2;
  525. NEXT_LINE:
  526.     down;
  527.     eol;
  528.     if c_col = 1 then
  529.         goto EXIT;
  530.     end;
  531.     if hard_cr <> '' then
  532.         if xpos(hard_cr, get_line, 1) then
  533.             goto EXIT;
  534.         end;
  535.     end;
  536.  
  537.     GOTO MAIN_LOOP;
  538.  
  539. EXIT:
  540.     goto_mark;
  541.     Make_Message('Paragraph justified.');
  542. EXIT2:
  543.     refresh := true;
  544.     wrap_stat := tw;
  545.     pop_undo;
  546.     redraw;
  547.     insert_mode := ti;
  548. END_MACRO;
  549.  
  550. $MACRO UNJUSTIF TRANS;
  551. {******************************************************************************
  552.                                                                 MULTI-EDIT MACRO
  553.  
  554. Name:    UNJUSTIF
  555.  
  556. Description: Unjustifies the current paragraph from the current cursor position
  557.                          down.
  558.  
  559.                              (C) Copyright 1989 by American Cybernetics, Inc.
  560. ******************************************************************************}
  561.     def_int( tw );
  562.     push_undo;
  563.     tw := wrap_stat;
  564.     wrap_stat := false;
  565.  
  566.     mark_pos;
  567.     refresh := false;
  568.  
  569.     Make_Message('Unjustifying paragraph...');
  570.     Working;
  571. main_loop:
  572.     first_word;
  573. {Check for end of paragraph}
  574.     if AT_EOL then
  575.         goto EXIT;
  576.     END;
  577.     if hard_cr <> '' then
  578.         if xpos(hard_cr, get_line, 1) then
  579.             goto EXIT;
  580.         end;
  581.     end;
  582.     while NOT( AT_EOL ) do
  583. {Skip over end of sentences, etc.}
  584.         if pos(cur_char,'.!?:') then
  585.             right;
  586.             right;
  587.         end;
  588. {Otherwise, remove occurances of more than one space}
  589.         if cur_char = ' ' then
  590.             right;
  591.             while cur_char = ' ' do
  592.                 del_char;
  593.             end;
  594.         end;
  595.         right;
  596.     end;
  597.     down;
  598.     goto Main_Loop;
  599. EXIT:
  600.     Make_Message('Paragraph Unjustified...');
  601.     wrap_stat := tw;
  602.     pop_undo;
  603.     refresh := true;
  604.     goto_mark;
  605.     redraw;
  606.  
  607. END_MACRO;
  608.  
  609. $MACRO RULER;
  610. {*******************************MULTI-EDIT MACRO******************************
  611.  
  612. Name: RULER
  613.  
  614. Description:  Puts up a character ruler at the cursor position.
  615.  
  616.                              (C) Copyright 1989 by American Cybernetics, Inc.
  617. ******************************************************************************}
  618.  
  619.     def_str( tstr, tstr2 );
  620.   def_int( jx, jy, jl, jk, old_col, t_line, offset, omm, ptr_removed );
  621.     refresh := TRUE;
  622.     if c_row < 3 then
  623.         offset := 1;
  624.     ELSE
  625.         offset := -2;
  626.     END;
  627.     redraw;
  628.     old_col := c_col;
  629.     tstr := '';
  630.     tstr2 := '';
  631.     jx := 0;
  632.     jy := 1;
  633.     jl := 0;
  634.     while jx < 254 do
  635.         tstr := tstr + str(jy);
  636.         ++jx;
  637.         ++jy;
  638.         if jy = 10 THEN
  639.             ++jx;
  640.             jy := 1;
  641.             tstr := tstr + '0';
  642.             ++jl;
  643.             tstr2 := tstr2 + copy('══════════', 1,10 - length(str(jl))) + str(jl);
  644.         END;
  645.     end;
  646.   omm := mouse_mode;
  647.   ptr_removed := FALSE;
  648.     make_message('Use |27|26 arrow keys, <HOME> and <END> to move.  Press <ESC> to exit ruler.');
  649. loop:
  650.     call put_ruler;
  651.   while NOT(check_key) DO
  652.     Mou_Check_Status;
  653.     IF ((Mou_Last_Status AND 1) = 0) THEN
  654.       mouse_mode := omm;
  655.       IF ptr_removed THEN
  656.         --ptr_removed;
  657.         mou_set_pos( wherex, wherey );
  658.         mou_draw_ptr;
  659.       END;
  660.     END;
  661.   END;
  662.     if key1 = 27 then
  663.         goto exit;
  664.     end;
  665.     if key1 = 0 THEN
  666.     if (key2 = 245) OR (key2 = 251) THEN
  667.             goto exit;
  668.     elsif (key2 = 250) THEN
  669.       IF (mou_last_x > win_x1) AND (mou_last_x < win_x2) AND
  670.             (mou_last_y = wherey) THEN
  671.         RM('MouseInWindow');
  672.         IF return_int THEN
  673.           mouse_mode := TRUE;
  674.           mou_reset;
  675.           mou_remove_ptr;
  676.           ++ptr_removed;
  677.         END;
  678.       END;
  679.     elsif (c_col < 2048) and ((key2 = 77) or (key2 = 243)) THEN
  680.             right;
  681.     elsif (c_col > 1) and ((key2 = 75) or (key2 = 242)) THEN
  682.             left;
  683.     elsif key2 = 71 THEN
  684.             goto_col(old_col);
  685.     elsif key2 = 79 THEN
  686.             eol;
  687.         END;
  688.     end;
  689.     goto loop;
  690.  
  691. put_ruler:
  692.     jy := c_col - (wherex - win_x1);
  693.     jk := 1;
  694.     if old_col <= jy THEN
  695.         jk := jy - old_col + 2;
  696.     END;
  697.     jx := old_col - jy;
  698.     if jx < 1 THEN
  699.         jx := 1;
  700.     end;
  701.  
  702.     jl := win_x2 - (win_x1 + jx);
  703.  
  704.     write( copy(tstr2, jk, jl), win_x1 + jx, wherey + offset, 0, h_color );
  705.     write( copy(tstr, jk, jl), win_x1 + jx, wherey + offset + 1, 0, h_color );
  706.     ret;
  707.  
  708. no_room:
  709.     Make_Message('No room in window for ruler.');
  710.     goto exit2;
  711. exit:
  712.     make_message('Ruler done.');
  713. exit2:
  714.   while ptr_removed > 0 DO
  715.     --ptr_removed;
  716.     mou_set_pos( wherex, wherey );
  717.     mou_draw_ptr;
  718.   END;
  719.   mouse_mode := omm;
  720.     redraw;
  721. END_MACRO;
  722.  
  723.  
  724. $MACRO END_OF_PARAGRAPH;
  725. {*******************************MULTI-EDIT MACRO******************************
  726.  
  727. Name: END_OF_PARAGRAPH
  728.  
  729. Description:  Finds the end of the current paragraph.
  730.  
  731.                              (C) Copyright 1989 by American Cybernetics, Inc.
  732. ******************************************************************************}
  733.  
  734.     Refresh := FALSE;
  735. LOOP:
  736.   IF (copy(get_line, 1, length(page_str)) = page_str) THEN
  737.     goto EXIT;
  738.   END;
  739.     EOL;
  740.     IF (c_col = 1) OR (At_EOF) THEN
  741.         goto EXIT;
  742.     END;
  743.     LEFT;
  744.   IF cur_char = Hard_CR THEN
  745.         goto exit;
  746.     END;
  747.     DOWN;
  748.     GOTO LOOP;
  749. EXIT:
  750. END_MACRO;
  751.  
  752. $MACRO NEXT_PARAGRAPH;
  753. {*******************************MULTI-EDIT MACRO******************************
  754.  
  755. Name: NEXT_PARAGRAPH
  756.  
  757. Description:  Finds the beginning of the next paragraph.
  758.  
  759.                              (C) Copyright 1989 by American Cybernetics, Inc.
  760. ******************************************************************************}
  761.  
  762.     RM( 'End_Of_Paragraph' );
  763.     Refresh := FALSE;
  764. LOOP:
  765.     DOWN;
  766.     First_Word;
  767.   IF (cur_char = Hard_Cr) OR (At_EOL) OR
  768.       (copy(get_line, 1, length(page_str)) = page_str) THEN
  769.         IF Not(At_EOF) THEN
  770.             Goto LOOP;
  771.         END;
  772.     END;
  773. END_MACRO;
  774.  
  775.  
  776. $MACRO MARKPOS;
  777. {*******************************MULTI-EDIT MACRO******************************
  778.  
  779. Name: MARKPOS
  780.  
  781. Description:  Just acts as an interface to the macro function MARK_POS.
  782.  
  783.                              (C) Copyright 1989 by American Cybernetics, Inc.
  784. ******************************************************************************}
  785.  
  786.     mark_pos;
  787.     make_message('Position marked.');
  788. END_MACRO;
  789.  
  790. $MACRO GOTOMARK;
  791. {*******************************MULTI-EDIT MACRO******************************
  792.  
  793. Name: GOTOMARK
  794.  
  795. Description:  Just acts as an interface to the macro function GOTO_MARK.
  796.  
  797.                              (C) Copyright 1989 by American Cybernetics, Inc.
  798. ******************************************************************************}
  799.     goto_mark;
  800.     make_message('Position retrieved.');
  801. END_MACRO;
  802.  
  803. $MACRO SET_MARK;
  804. {******************************************************************************
  805.                                                                 MULTI-EDIT MACRO
  806.  
  807. Name:        SET_MARK
  808.  
  809. Description:    Uses the new random access marker stack to set 10 markers.
  810.                 If SET_MARK is executed without parameters, the user is prompted
  811.                 to press a number key (0-9, 0=10) to specify the marker #.  If a
  812.                 value of 1-10 is passed as a parameter, then the specified mark
  813.                 is set without prompting the user.
  814.  
  815. Parameters:        MParm_Str can contain 1-10 to denote going directly to the mark.
  816.                             If the entire MParm_Str does not contain numeric characters, this
  817.                             option will not work, and the menu will be invoked.  Under these
  818.                             circumstances, the following parameters are expected:
  819.                             /X=        The X coordinate for the menu
  820.                             /X=        The X coordinate for the menu
  821.                             /BC=    The amount of boxes which need to be killed upon exit
  822.  
  823.                              (C) Copyright 1989 by American Cybernetics, Inc.
  824. ******************************************************************************}
  825.  
  826.     def_int( jx, bc );
  827.  
  828.         {If a numeric parameter was passed then use it, and bypass
  829.          the prompting}
  830.     if Val(jx, MParm_Str) = 0 THEN
  831.         if (jx > 0) and (jx < 11) then
  832.             goto do_set;
  833.         end;
  834.     end;
  835.  
  836.     RM('USERIN^XMENU /B=1/L=Select marker # to set/X=' + parse_str('/X=', mparm_str) +
  837.                             '/Y=' + parse_str('/Y=', mparm_str) +
  838.                             '/M=1 (CU)2 ()3 ()4 ()5 ()6 ()7 ()8 ()9 ()0 ()');
  839.     if return_int <= 0 then
  840.         goto exit;
  841.     end;
  842.     jx := return_int;
  843.     return_int := 100;
  844. do_set:
  845.     bc := parse_int('/BC=', mparm_str);
  846.     while box_count > bc do
  847.         kill_box;
  848.     end;
  849.     set_mark( jx );
  850.     make_message('Marker #' + str(jx) + ' set.' );
  851. exit:
  852. END_MACRO;
  853.  
  854. $MACRO GET_MARK;
  855. {******************************************************************************
  856.                                                                 MULTI-EDIT MACRO
  857.  
  858. Name:        GET_MARK
  859.  
  860. Description:    Uses the new random access marker stack to retrieve 10 markers.
  861.                         If GET_MARK is executed without parameters, the user is prompted
  862.                         to press a number key (0-9, 0=10) to specify the marker #.  If a
  863.                         value of 1-10 is passed as a parameter, then the specified mark
  864.                         is retrieved without prompting the user.
  865.  
  866. Parameters:        MParm_Str can contain 1-10 to denote setting that particular mark.
  867.                             If the entire MParm_Str does not contain numeric characters, this
  868.                             option will not work, and the menu will be invoked.  Under these
  869.                             circumstances, the following parameters are expected:
  870.                             /X=        The X coordinate for the menu
  871.                             /X=        The X coordinate for the menu
  872.                             /BC=    The amount of boxes which need to be killed upon exit
  873.  
  874.                              (C) Copyright 1989 by American Cybernetics, Inc.
  875. ******************************************************************************}
  876.  
  877.     def_int( jx, bc );
  878.  
  879.         {If a numeric parameter was passed then use it, and bypass
  880.          the prompting}
  881.     if Val(jx, MParm_Str) = 0 THEN
  882.         if (jx > 0) and (jx < 11) then
  883.             goto do_get;
  884.         end;
  885.     end;
  886.     RM('USERIN^XMENU /B=1/L=Select marker # to retrieve/X=' + parse_str('/X=', mparm_str) +
  887.                             '/Y=' + parse_str('/Y=', mparm_str) +
  888.                             '/M=1 (CU)2 ()3 ()4 ()5 ()6 ()7 ()8 ()9 ()0 ()');
  889.     if return_int <= 0 then
  890.         goto exit;
  891.     end;
  892.     jx := return_int;
  893.     return_int := 100;
  894. do_get:
  895.     bc := parse_int('/BC=', mparm_str);
  896.     while box_count > bc do
  897.         kill_box;
  898.     end;
  899.     get_mark( jx );
  900.     make_message('Marker #' + str(jx) + ' retrieved.' );
  901. exit:
  902. END_MACRO;