Macro doesn't restore initial settings

Macro doesn't restore initial settings

8
NewbieNewbie
8

    Oct 12, 2007#1

    Hello,

    I use Unix Regex syntax with my searches in UE. However, for a particular macro, I found the UltraEdit Regex syntax easier, so I add a UnixReOff at the beginning.

    I thought those settings, as InsertMode, ColumnMode and HexMode were used to make sure a macro could run, whatever settings the user currently use, and thus the setting were reverted automatically

    Yet each time I use this macro, my settings are left with UltraEdit Regex syntax, and I have to change manually...
    Is there a way to restore my settings automatically ?

    Regards,
    plastic

    6,681583
    Grand MasterGrand Master
    6,681583

      Oct 12, 2007#2

      I'm afraid not. I requested 2 macro commands to save current environment and restore it per email on Feb. 2006, but it looks like I was alone with that wish.

      In the script environment since v13.10 it is possible to get an info about insert mode on/off and hex mode on/off at start of the script, remember it in variables and restore the modes at the end of the scripts accordingly.

      Whether in the script nor in the macro environment the status of column mode or which regular expression is currently active can be determind and later restored.

      However, for your macro there is a simple solution as I always write when I post a macro which uses UltraEdit regular expressions.

      Add UnixReOn or PerlReOn (v12+ of UE) at the end of the macro if you do not use UltraEdit style regular expressions by default - see search configuration.
      Best regards from an UC/UE/UES for Windows user from Austria

      8
      NewbieNewbie
      8

        Oct 16, 2007#3

        Too bad, if I ever change my mind in the future (this could happen), I would have to remember to change ALL my macros !

        For someone as lazy as me, this seems quite inelegant...

        Thanks for your reply anyways :)

        Regards,
        plastic

        206
        MasterMaster
        206

          Oct 16, 2007#4

          Make a configuration macro that specifies all the default macro settings as you like them, then add a PlayMacro command at the end of each of your existing macros to run it and reinstate the settings.

          A small bit of work up front (you're not THAT lazy), only one macro to maintain when you want to change your default macro settings in the future.
          Software For Metalworking
          http://closetolerancesoftware.com

          8
          NewbieNewbie
          8

            Oct 31, 2007#5

            I have to say that's quite the good idea, I wish I'd think of it by myself !

            Regards,
            plastic