home *** CD-ROM | disk | FTP | other *** search
- /* CHESS FUNCTION(S): do_comment(int aft)
- /* DATE: 3/22/93
- /* AUTHOR: C. Schanck
- /*
- /* DESCRIPTION: This function will comment the currently
- /* linemarked block of text with a leading '/* ' string (for C and
- /* Chess program files. If the argument 'aft' is set to a non-zero
- /* value, the end of each of the lines will have the string ' */'
- /* appended to it (for C files).
- /*
- /* REVISION HISTORY:
- /* Author Date Purpose
- /* ------ ---- -------
- do_comment
- int aft
- {
- int retval,top,bot,aft;
- set_display(0); /* turn the display off...
- if(ask("file_in_mark")==1) /* do we have a line marked block
- {
- Line_mark(); /* end the line mark
- Top_of_block(); /* go to the top
- Begin_line();
- set_recall(""); /* forget the entries
- Replace("~^~ ~////* ~ ~mgrp~"); /* replace the beginning of the line
- if(aft)
- { /* if we are to do the end as well
- set_msg_wait(0); /* turn message wait off for replace
- while(Search("~$~ ~mr~")!=0) /* for each eol
- {
- put_text_curr(0," */"); /* append string
- Begin_line(); /* go to the beginning
- if(Cursor_down()==0) /* next line, if possible
- break;
- }
- }
- retval=1; /* successful
- }
- else
- retval=0; /* failed
-
- set_display(1); /* re-enable display
- update_display(); /* repaint screen
- return(retval); /* return value
- }