I want Replace default to be "Entire Document"
I want Replace default to be "Entire Document"
When I perform a replace I want the default to be ReplaceAll. Is this still programmable. There use to be a line in my old ZEUS.INI file which is ReplaceAll=1. This doesn't seem to work anymore.
The answer is yes and noWhen I perform a replace I want the default to be ReplaceAll. Is this still programmable.

If you use the Edit, Replace menu or the toolbar button to run the replace then the anser is no

If you initialte the replace using a keyboard shortcut then the answer is yes

The reason is the toolbar and menu are hard coded to run the ReplaceWordCurrent keyboard function, while keyboard can be re-configured.
The following macro script implements the required replace feature:
Code: Select all
function key_macro()
screen_update_disable()
-- save the current search options (this is optional)
search_options_save()
-- set the scope required
SearchScopeEntire()
-- control of other search settings (these are optional)
SearchCaseSet()
SearchCaseReset()
SearchWordSet()
SearchWordReset()
SearchRegexpSet()
SearchRegexpReset()
-- display the replace dialog
ReplaceDialog()
-- restore the origianl search options (this is optional)
search_options_restore()
screen_update_enable()
screen_update()
end
key_macro() -- run the macro
To test the macro use the Macros, Execute Script menu and type replace. The macro will execute and display the replace dialog with the scope set to "Enite document".
The final step is to bind the macro to the keybaord. For more imformation on how this is done see the Binding a Macro to the Keyboard example.

I even added the lines below to make the macro totally intrinsic.
local fs_search_text = "@" -- where @ = a very crazy ascii char
local fs_replace_text = " " -- replace with a blank
set_find_text(fs_search_text)
set_replace_text(fs_replace_text)
By reading all your macros in zScript I'm starting to get the hang
of it.
Take care, Steve