I want Replace default to be "Entire Document"

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
ordba
Posts: 6
Joined: Fri Aug 27, 2004 12:44 pm

I want Replace default to be "Entire Document"

Post by ordba » Thu Sep 02, 2004 8:55 pm

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.

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Fri Sep 03, 2004 5:10 am

When I perform a replace I want the default to be ReplaceAll. Is this still programmable.
The answer is yes and no :?

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
Save this macro to the replace.lua file in the zScript directory located off the Zeus install directory.

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.

Guest

Post by Guest » Fri Sep 03, 2004 8:27 am

:D Thanks Jussi,

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

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Fri Sep 03, 2004 4:16 pm

By reading all your macros in zScript I'm starting to get the hang
of it.
With a bit of practice I am sure you will soon get the hang of the Zeus macros :)

And if you run into a problem, just post a message to the forum and I will be happy to offer my assistance.

Cheers Jussi

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 38 guests