Macro Syntax and Commands

Table 6-1. Filters and Flags
filter_set [extension] Set the file flag to extension .
filter_set *.txt
filter_add [extension] Add the extension file flag.
filter_add *.cpp
filter_clear Clears the File Flags list and resets it to All Files.
filter_clear

Table 6-2. Drives and Directories
chd [drive] Change current drive to drive . You can use a network location with this command.
chd \\server\share
cd [directory] Change current directory to directory . You can use a network location or a relative directory.
cd c:\xreplace

Table 6-3. Files List
file_select [file] Select file in the Files List. This does not tag the file for replacements, it just selects it in the list.
file_select foo.txt
file_clear Clear all selections in the Files List.
file_clear
file_deselect [file] Clear a file selection in the Files List.
file_deselect foo.txt

Table 6-4. File Selection
dirdragdrop Select (drag and drop) the current directory in the Directories List.
dirdragdrop
filedragdrop Select (drag and drop) the currently selected files in the Files List.
filedragdrop
wildcard_select [extension] Select a particular type of files in the current directory.
wildcard_select *.txt
wildcard_drop [extension] Select a particular type of files in the current directory and all subdirectories.
wildcard_drop *.txt
removeall Remove all selected files from the Selected Files List.
removeall

Table 6-5. Replacements Grid
grid_clear Clear the replacements grid.
grid_clear
grid_invert Invert the replacements grid.
grid_invert
grid_load [file] Load a previously saved replacements grid (.xpl file).
grid_load c:\xreplace\all.xpl

Table 6-6. XReplace-32 Options
case_sensitive [true/false] Set or unset the case-sensitive search-and-replace option.
case_sensitive false
ignore_errors [true/false] Set or unset the ignore errors option.
ignore_errors true
include_source [true/false] Set or unset the include source for inter-line option.
include_source false
whole_words [true/false] Set or unset the whole words only search-and-replace option.
whole_words true
copy_redirect [true/false] Set or unset the always copy redirected option.
copy_redirect true
reg_exp [true/false] Set or unset the regular expressions mode.
reg_exp false

Table 6-7. Macros and Commands
call [filename] Execute a different macro.
call c:\xreplace\macro2.xrm
go Launch a replacement operation. Note that in unattended mode, the replacement operation is launched automatically after running a macro.
go
quit Terminate XReplace-32. Note that in unattended mode, after the replacement operation is complete, XReplace-32 automatically terminates.
quit

Note

When you run a macro in unattended mode, XReplace-32 will not interrupt it when a syntax error occurs. It will simply ignore the problematic line. An entry in the log file will be created if you choose to have a log file.