/**************************************************************************** ** PROJECT ** PACK ** ***************************************************************************** ** FUNCTION ** THIS (VERY) BRIEF MACRO REMOVES ALL REDUNDANT SPACE FROM A ** ** ** FILE. I.E. SPACES/TABS ON THE END OF LINES ** ***************************************************************************** ** AUTHOR ** WARREN D HUMPHREYS ** ***************************************************************************** ** DATE ** TUESDAY 16TH JULY 1991 ** ***************************************************************************** ** COMMENTS ** ** ***************************************************************************** ** MODIFICATION HISTORY ** ***************************************************************************** ** DATE ** WHO ** CHANGED WHAT ** ***************************************************************************** ** ** ** ** ****************************************************************************/ /**************************************************************************** ** FUNCTION PROTOTYPES ** ****************************************************************************/ int Pack(void); /**************************************************************************** ** GLOBAL VARIABLES ** ****************************************************************************/ /**************************************************************************** ** ACTUAL FUNCTIONS ** ****************************************************************************/ int Pack() { int Count; string Reply; get_parm(NULL,Reply,"Remove all redundant space from file [Y|N]? ",1, "N"); if (upper(Reply)=="Y") { save_position(); top_of_buffer(); message("Removing redundant space from file..."); Count=translate("{[ \t]+>}","",1,1,0,0,1); restore_position(); if (Count==0) message("No redundant space found"); else message("%d occurence%s of redundant space %s removed",Count, (Count==1) ? "" : "s",(Count==1) ? "was" : "were"); } }