/* $VER: UnEcomment.ged 0.6 (04.04.98) By Map ** ** Remove Ecomment markers printed by Ecomment.ged ** Control presence of Emarkers and delete them */ OPTIONS RESULTS /* enable return codes */ if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */ address 'GOLDED.1' 'LOCK CURRENT RELEASE=4' /* lock GUI, gain access */ if (RC ~= 0) then exit OPTIONS FAILAT 6 /* ignore warnings */ SIGNAL ON SYNTAX /* ensure clean exit */ /* ------------------------ INSERT YOUR CODE HERE: ------------------- */ emark = "-- EComment --" /* string to search */ /* with option "FIRST" search start from begin of file. If you want start from cursor position write "NEXT" */ 'FIND FIRST CASE=TRUE QUIET STRING="'emark'"' a = 1 if (RC = 0) then do 'DELETE LINE' 'FIND NEXT CASE=TRUE QUIET STRING="'emark'"' a = 2 if (RC = 0) then 'DELETE LINE' /*remove line of first Emarker */ else call bye(a) /* control on SECOND Emarker */ end else call bye(a) /* control on FIRST Emarker */ /* ---------------------------- END OF YOUR CODE --------------------- */ 'UNLOCK' /* VERY important: unlock GUI */ exit /* if a Emarker is NOT found */ bye: 'REQUEST PROBLEM=" Emarker #'a' NOT found"' 'UNLOCK' exit SYNTAX: SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-(" 'UNLOCK' exit