* * GCHANGE.KEX (Global CHANGE) * * Issue a CHANGE command against every file in the ring. * * Works with: * * KEDIT for Windows 1.5 * KEDIT 5.0 for DOS * KEDIT 5.0 for OS/2 * * As an example, if you wanted to change every occurrence of "sunlight" * to "moonlight" in all files currently in the ring, you would issue * the command: * * macro gchange /sunlight/moonlight/ all * * * As an alternative, you might add the following to your KEDIT profile: * * if initial() then do * "define gchange.kex" * "set synonym gc macro gchange" * end * * Now to make the same change as above you would issue the command: * * gc /sunlight/moonlight/ all * * * Retrieve the argument, e.g., "/John/Jane/ * *" parse arg ChangeArg if ChangeArg = "" then do "emsg GCHANGE Error 1: You must specify a CHANGE command operand..." exit 1 end * Remember the current fileid CurrentFile = fileid.1() * Issue the CHANGE command against the current file. If we get an error then * just stop since the argument may be mistyped "nomsg change" ChangeArg if rc > 1 then do * Echo the error message that this generated say "GCHANGE Error 2:" lastmsg.1() exit 2 end * Move to the next file in the ring "kedit" * Move through each file in the ring and issue the CHANGE command. Stop when * we return to the original file do while fileid.1() \= CurrentFile "nomsg change" ChangeArg "kedit" end