!************************* PROCEDURE BUFFER_UPSHIFT local this_buffer, this_line, this_position; this_position := mark(none); this_buffer := current_buffer; eocb := end_of(current_buffer); position(beginning_of(this_buffer)); loop this_line := current_line; edit(this_line, upper, off); move_text(this_line); split_line; erase_line; exitif mark(none) = eocb; endloop; position(this_position); ENDPROCEDURE; !************************* PROCEDURE CONVERT_DATE ! ! This procedure will convert an 8 character date field from the following ! formats (m/d/yy, mm/d/yy, mm/dd/yy, m/dd/yy, etc.) to 'YYMMDD '. ! The conversion begins on the current line and continues to the end of ! the current buffer. ! local date_string, new_date_string, month, day, year, this_char, eocb; eocb := end_of(current_buffer); loop ! ! Change the 2nd parameter (the one after 'current_line, ') to the beginning ! column # of the date field in your file you wish to convert. ! if substr(current_line, 77, 8) <> ' ' then ! ! Change the parameter in the following line to 1 less than the 2nd parameter ! in the above line ! move_horizontal(76); date_string := erase_character(8); new_date_string := '000000'; this_char := index(date_string, '/'); month := substr(date_string, 1, (this_char - 1) ); if this_char-1 = 1 then month := '0' + month; endif; date_string := substr(date_string, (this_char + 1), (8 - this_char) ); this_char := index(date_string, '/'); day := substr(date_string, 1, (this_char - 1) ); if this_char-1 = 1 then day := '0' + day; endif; year := substr(date_string, (this_char + 1), 2); new_date_string := year + month + day + ' '; move_horizontal(-current_offset); ! ! Change the parameter in the following line to the same value in the ! move_horizontal statement found earlier in this procedure ! move_horizontal(76); copy_text(new_date_string); endif; move_horizontal(-current_offset); move_vertical(1); exitif mark(none) = eocb; endloop; ENDPROCEDURE; !************************* PROCEDURE DELETE_NULL_LINES ! ! This procedure will delete all null lines (length = 0) in the current buffer. ! Local eocb, this_line, this_length; eocb := end_of(current_buffer); eve_trim_buffer; ! trim all trailing whitespace loop; this_line := current_line; this_length := length(this_line); if this_length = 0 then erase_line; ! delete this line of length = 0 exitif mark(none) = eocb; else move_vertical(1); ! skip this line when length > 0 exitif mark(none) = eocb; endif; endloop; ENDPROCEDURE; !************************* PROCEDURE SPLIT_LINES(RECL) ! ! This procedure will split all lines in the current buffer from the current ! position to the end of the buffer at the column specified by the user ! Local recl, this_record, this_offset, eocb; if recl = 0 then message("No column specified for split -- reenter command specifying"); message(" a column value > 0."); return; endif; eocb := end_of(current_buffer); this_offset := recl; move_horizontal(-current_offset); loop; move_horizontal(this_offset); split_line; move_vertical(1); exitif mark(none) = eocb; endloop; ENDPROCEDURE; !************************* PROCEDURE ADD_COLUMNS(NUMBER_OF_COLS) ! ! This procedure will add blanks to each line of the current buffer from ! the current line to the end of the buffer. Columns will be added at the ! current cursor column. User must specify the number of blanks to add. ! Up to 80 blanks per line may be specified. ! local eocb, number_of_cols, blanks; eocb := end_of(current_buffer); blanks := " "; loop; copy_text(substr(blanks, 1, number_of_cols)); move_horizontal(-number_of_cols); move_vertical(1); exitif mark(none) = eocb; endloop; ENDPROCEDURE; !************************* PROCEDURE CHECK73 ! ! This procedure will check the current buffer to see if there are any non-null ! (including blanks) characters in column 73. When a non-null char is found ! in col. 73 the search will stop and the cursor will be placed in column ! 73 of the offending line. ! This macro is useful in checking FORTRAN programs for code that goes beyond ! column 72. ! local eocb, this_char; eocb := end_of(current_buffer); loop move_horizontal(-current_offset); cursor_horizontal(72); this_char := current_character; exitif this_char <> ""; move_vertical(1); exitif mark(none) = eocb; endloop; eve_trim_buffer; ENDPROCEDURE; !************************* PROCEDURE CHECK_COLUMN(COLUMN_TO_CHECK) ! ! This procedure will check the current buffer to see if there are any non-null ! (including blanks) characters in column specified by the user. ! The search will stop and the cursor will be placed in column specified ! by the user of the offending line. ! local eocb, this_char; eocb := end_of(current_buffer); loop move_horizontal(-current_offset); cursor_horizontal(59); this_char := current_character; exitif this_char <> ""; move_vertical(1); exitif mark(none) = eocb; endloop; eve_trim_buffer; ENDPROCEDURE;