PROCEDURE strip_blanks ! ! Remove trailing blanks from all the lines in a buffer ! LOCAL blank_chars, blank_pattern, blank_range; ON_ERROR RETURN; ENDON_ERROR; blank_chars := ASCII (32) + ASCII (9); blank_pattern := (SPAN (blank_chars) @ blank_range) & LINE_END; LOOP SEARCH (blank_pattern, FORWARD); POSITION (BEGINNING_OF (blank_range)); ERASE (blank_range); ENDLOOP; ENDPROCEDURE; ! ! Create a buffer containing the specified file ! in_file := GET_INFO (COMMAND_LINE, "file_name"); work_buffer := CREATE_BUFFER ("Work Buffer", in_file); POSITION (BEGINNING_OF (work_buffer)); ! ! Strip the blanks, then write out the file ! strip_blanks; WRITE_FILE (work_buffer); QUIT;