/* ** html_strip.ced ** ** $VER: html_strip.ced 2.2 (03.09.1999) ** ** Arexx script to erase all HTML v3.2 comments ** ** This script works with CygnusEd Professional v4.2 ** ** Copyright © Eric BELLE */ /* **------------------------------------------------------------------------------ ** Initialisation **------------------------------------------------------------------------------ */ OPTIONS RESULTS /* Tell CygnusEd to return results. */ NL = '0A'X /* Alias for new line. */ KRETURN = RAWKEY 68 /* Shortcut to the return key. */ KTAB = RAWKEY 66 /* Shortcut to the tab key. */ STATUS TABSARESPACES /* Return TAB mode ("tab" or "space"). */ IF RESULT = 1 /* Test the TAB mode. */ THEN "TABS = SPACES" /* Switch TAB mode from "space" to "tab". */ ELSE NOP /* No operation. */ TAB SIZE 1 /* Set TAB size proportional to 2 spaces. */ /* **------------------------------------------------------------------------------ ** Important message **------------------------------------------------------------------------------ */ OKAY2 , "Clear comments: " || NL ||, "~~~~~~~~~~~~~~ " || NL ||, " " || NL ||, " - One entire line should has been used for each comment. " || NL ||, ' - All comments should have been well defined with "" HTML comment tags. ' || NL ||, " " || NL ||, " Each comment line will be discarded. " IF (RESULT=0) THEN EXIT 0 ELSE NOP /* **------------------------------------------------------------------------------ ** Erase all comments in HTML source code **------------------------------------------------------------------------------ */ BEG OF FILE MoreComments = "yes" DO WHILE (MoreComments="yes") SEARCH FOR "" 1 0 1 0 0 IF (RESULT=1) THEN DO STATUS LINENUMBER EndCommentLine = RESULT + 1 IF (BeginCommentLine=EndCommentLine) THEN DO DELETE LINE NewBeginline = BeginCommentLine - 1 LL NewBeginLine END ELSE DO NewBeginline = BeginCommentLine LL NewBeginLine END END ELSE MoreComments = "no" END ELSE MoreComments = "no" END "END OF FILE" SEARCH FOR "" 1 0 1 0 0 IF (RESULT=1) THEN DO STATUS LINENUMBER EndCommentLine = RESULT + 1 IF (BeginCommentLine=EndCommentLine) THEN DELETE LINE ELSE NOP END ELSE NOP END ELSE NOP /* **------------------------------------------------------------------------------ ** End of html_strip.ced Arexx script **------------------------------------------------------------------------------ */ EXIT 0