Author Topic: vusrdefs.e  (Read 4833 times)

asipe

  • Senior Community Member
  • Posts: 113
  • Hero Points: 4
vusrdefs.e
« on: April 21, 2008, 10:04:26 pm »
I was playing around with some insert_name and replace_name in a macro.   I ended up getting some items into the file that are not valid.  If I edit the file by hand the values just come back when I restart slick edit.   

Any idea where might I look to remove these values?

Thanks -andy

Graeme

  • Senior Community Member
  • Posts: 2387
  • Hero Points: 314
Re: vusrdefs.e
« Reply #1 on: April 21, 2008, 10:48:46 pm »
I was playing around with some insert_name and replace_name in a macro.   I ended up getting some items into the file that are not valid.  If I edit the file by hand the values just come back when I restart slick edit.   

Any idea where might I look to remove these values?

Thanks -andy

I assume from the subject that the file in question is vusrdefs.e.  This file gets rewritten when you exit slickedit if you have "save configuration" selected without prompting.  If you have a saved good copy of vusrdefs.e, you could compare them to be sure you know what needs changing.  Then with slickedit open, make the changes to vusrdefs.e and reload it  - to reload it, you type the name, including full path, on the command line and press return  - vusrdefs.e is a batch macro.  Whether this works might depend on what the "corrupted" values were so you might also need to delete vslick.sta (with slick closed), edit vusrdefs.e to have sensible values, then start slick.  (Try at your own risk!  Good luck.)

Graeme

asipe

  • Senior Community Member
  • Posts: 113
  • Hero Points: 4
Re: vusrdefs.e
« Reply #2 on: April 22, 2008, 11:29:12 am »
Thanks Graeme,

That seemed to fix the problem.  I ended up having to remove the vslick.sta file to get things working again.

What I was trying to do was change the alias file that a language uses via the SE command line.  Prior to V13 this could be done in the options dialog but it was removed.

I'm still pretty new to the SE macro language and my first attempt was what got the vusrdefs.e file out of wack.  In fact, I had a version of the macro working for a while before I realized that it was adding entries to the vusrdefs.e file with each execution.

This is what I've come up with so far, it seems to work fine but now I'm wondering if it is having any other side effects that I'm unaware of:

Quote
#include "slick.sh"
_command set_alias(_str info="cs-cs")
{
  _str ext = '';
  _str als = '';

  parse info with ext'-'als;
  idx = find_index("def-alias-"ext, MISC_TYPE);
  set_name_info(idx, als".als");
  message("'"ext"' set to use '"als"' alias file");
}

Usage:   
set_alias html-ascx       //this would set the html language to use an ascx.als file
set_alias cs-prjabc       //this would set the cs language to use an prjabc.als file

All it does is split a string in the form of language-aliasfilename into its parts and the find the index of the setting.  It the sets the setting and notifies the user.   Anyone see if this code is gonna have any weird side effects with the configuration?

Thanks -andy
« Last Edit: April 22, 2008, 12:13:04 pm by asipe »