home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!destroyer!cs.ubc.ca!mala.bc.ca!epp
- From: epp@mala.bc.ca (Lorne Epp)
- Newsgroups: comp.os.vms
- Subject: Re: TPU: proc to delete trailing spaces
- Message-ID: <1992Dec23.204901.1150@mala.bc.ca>
- Date: 23 Dec 92 20:49:01 -0700
- References: <1992Dec23.062138.3034@hubcap.clemson.edu>
- Organization: Malaspina College
- Lines: 30
-
- In article <1992Dec23.062138.3034@hubcap.clemson.edu>, rsimms@hubcap.clemson.edu (Robert Simms) writes:
- > Together with a friend, I came up with the following procedure
- > that I keep in my tpu$command file:
- >
- > procedure eve_erase_trailing_spaces
- > local count, kill_range;
- > count := 0;
- > loop exitif 0 = search_quietly ( (span(" ")@ kill_range) & line_end,
- > forward);
- > position (kill_range);
- > erase (kill_range);
- > count := count +1;
- > endloop;
- > if count = 0
- > then
- > message('No trailing spaces found.');
- > else
- > message('Trailing spaces removed from '+str(count)+' lines.');
- > endif;
- > endprocedure;
- >
-
- You could have got away with:
-
- procedure eve_erase_trailing_spaces
- eve$trim_buffer( current_buffer );
- endprocedure
-
- ----------------------------------------------------------------------
- Lorne Epp epp@mala.bc.ca
-