Programmer's WorkBench (pwb.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Replace Macro Example
 Description                               Up Contents Index Back
─────Programmer's WorkBench─────────────────────────────────────────────────
 
     To use the replace function in a macro, use the following phrase:
 
          ...Replace "pattern" Newline "replacement" Newline +>found...
 
     Enter the replies to the prompts as you would when executing
     Replace interactively. This example also shows where to place the
     conditional to test the result of Replace.
 
     You can specify special characters in the find-and-replacement
     strings by using escape sequences similar to those in the C
     language. Note that backslashes in the macro string must be
     doubled.
 
     To restore the usual prompts, use the phrase:
 
          ...Replace <
 
     To use an empty replacement text (replace with nothing), use the
     following phrase:
 
          ...Replace "pattern" Newline " " Cdelete Newline...
 
     If you find that you write many macros with empty replacements,
     the common phrase can be placed in a macro, as follows:
 
          nothing := " " Cdelete Newline
 
     In addition, macro definitions can be more readable with the
     following definition:
 
          with := Newline
 
     With these definitions, you can write:
 
          ... Replace "pattern" with nothing ...
 
     See
 
     Regular Expressions
     Macro Prompt Directives
     Macro Conditionals
     Macro String Syntax
                                    -♦-