Author Topic: Macro variable settings not migrated  (Read 1853 times)

jnairb

  • Senior Community Member
  • Posts: 221
  • Hero Points: 11
Macro variable settings not migrated
« on: September 15, 2016, 04:07:17 am »
I have a few user macros that have one or more macro variables defined to allow customization of some of the processing. These variables were reset to their default values when I installed RC1 and it migrated my 20.0.3 config. (It may have happened on the betas as well, but I just noticed it now.) When I installed RC1, I renamed my 21.0.0 config directory from beta 5 so the migration did occur under RC 1.

In one macro, I have the following statement:

_str def_cmvc_log_file = '%TMP%\cmvc.log';

In my 20.0.3 config, the value is modified from the default and is set to 'C:\Users\bej\Logs\vs-cmvc.log'. In the migrated 21.0.0 config, the value is now the default ('%TMP%\cmvc.log').

In another macro, I have:

int def_flow_comment_end_column;

In my 20.0.3 config, it has the value 71, while my 21.0.0 config has the value 0.

Past releases did migrate these settings. I verified this by renaming my 20.0.3 config and allowing 20.0.3 to migrate from my 19.0.2 config directory which I still have around.

Should VS 21 have migrated these settings?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4960
  • Hero Points: 409
Re: Macro variable settings not migrated
« Reply #1 on: September 15, 2016, 11:48:15 am »
I haven't been able to reproduce this. I wonder if your macro wasn't loaded into v21 during the migration.

Was you macro loaded after the v20 to v21 migration? Or did you have to manually load it?

jnairb

  • Senior Community Member
  • Posts: 221
  • Hero Points: 11
Re: Macro variable settings not migrated
« Reply #2 on: September 15, 2016, 12:00:32 pm »
It was manually loaded by running vusrmods (with a makeNload statement for each user macro) after the migration. For v20 this works. For v21 it doesn't.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4960
  • Hero Points: 409
Re: Macro variable settings not migrated
« Reply #3 on: September 15, 2016, 12:13:13 pm »
That is a new difference now. v21 no longer generates vusrdefs.e any more. After migration, the old vusrdefs.e is deleted after it is executed. def_vars are stored in "user.cfg.xml" along with many other settings.

v21 requires the macro code and variables to be migrated at the same time.

In addition to running vusrmods, run can the vusrdefs.e out of your v20 config to get your old def var settings.

jnairb

  • Senior Community Member
  • Posts: 221
  • Hero Points: 11
Re: Macro variable settings not migrated
« Reply #4 on: September 15, 2016, 05:40:53 pm »
How is this supposed to work for future releases? How do I get my macro code and variables migrated at the same time?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4960
  • Hero Points: 409
Re: Macro variable settings not migrated
« Reply #5 on: September 15, 2016, 07:23:06 pm »
You should be able to get SlickEdit to automatically load your macros when the settings are migrated.

As a test, I put a custom macro file in the My SlickEdit Config directory. Loaded it in v20. Then ran v21 and it loaded the macro add set the def var when the settings were migrated. 

jnairb

  • Senior Community Member
  • Posts: 221
  • Hero Points: 11
Re: Macro variable settings not migrated
« Reply #6 on: September 15, 2016, 08:25:36 pm »
But how is that supposed to happen? I've always loaded my user macros through a call to makeNload in vusrmods because many releases ago that seemed to be the answer to automatically loading my macros when I upgraded. If my macros are supposed to be automatically migrated when I upgrade, that doesn't seem to ever happen for me, so I continue to use vusrmods. And that's probably why I also had problems with losing key bindings for my user macros during v21 migration until you put in a fix for that (https://community.slickedit.com/index.php/topic,13623.0.html).

How do I get things to work like you say it should work?

jnairb

  • Senior Community Member
  • Posts: 221
  • Hero Points: 11
Re: Macro variable settings not migrated
« Reply #7 on: September 15, 2016, 10:39:57 pm »
From SlickEdit v20, I unloaded all my user macros, then loaded them manually rather than using vusrmods. Exited VS 20, renamed my current 21.0.0 config directory, and started VS 21. After this migrated my 20.0.3 config, my macros are loaded and the macro variables they use are the same as from my VS 20 config.

If makeNload doesn't work to correctly load macros so that they can migrate upon upgrade, should it be removed/deprecated? Should the shipped version of vusrmods.e be changed? VS 21 certainly does not seem to upgrade correctly when vusrmods.e/makeNload is used.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2831
  • Hero Points: 429
Re: Macro variable settings not migrated
« Reply #8 on: September 15, 2016, 11:29:59 pm »
makeNload() is a bit low-level.  It doesn't update def_macfiles, which holds the list of user-loaded macros.  It also doesn't add the macro to your Slick-C tag file.

You could use load(), or if you wanted to stay low-level, add a call to _macfile_add() after makeNload() to do the bookkeeping.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4960
  • Hero Points: 409
Re: Macro variable settings not migrated
« Reply #9 on: September 16, 2016, 02:19:04 am »
I didn't mention that I used the load command (same as gui_load) to load the macro so it would be migrated. As Dennis noted, makeNload is a bit low level and won't add macros to the migration list.