Author Topic: Trying to debug slickedit macro with dsay()... "vs.log" not created  (Read 4847 times)

pieterc

  • Community Member
  • Posts: 43
  • Hero Points: 3
Hi everyone,

I'm completely new to Slick-C macros and need some guidance / help.

I'm trying to figure out why icon overlays are not working for SVN and added "dsay()" macros inside "c:\Program Files\SlickEdit Pro 22.0.0\macros\filewatch.e". I loaded the module again and restarted SlickEdit. A "vs.log" file is not created in:
c:\Users\<MY USER NAME>\Documents\My SlickEdit Config\22.0.0\logs

What am I doing wrong? Is there a recommended way to single step / debug "c:\Program Files\SlickEdit Pro 22.0.0\macros\filewatch.e"?

Thanks in advance,
Pieter

Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
Re: Trying to debug slickedit macro with dsay()... "vs.log" not created
« Reply #1 on: September 28, 2017, 10:21:45 AM »
dsay works for me.  At a guess, your call to dsay isn't getting executed.  You could try the slick c debugger and set a breakpoint.  Have you seen the "Slick C programming best practices..." document in the installation docs folder - it doesn't mention the slick c debugger but it has some useful information.




pieterc

  • Community Member
  • Posts: 43
  • Hero Points: 3
Re: Trying to debug slickedit macro with dsay()... "vs.log" not created
« Reply #2 on: September 28, 2017, 01:57:53 PM »
Hi Graeme,
Thanks for pointing me towards "SlickCMacroBestPractices.pdf". It helped a lot!
I still have a problem though. As an experiment, I edited "util.e" and added a call to say(), dsay() and messageNwait() inside gui_sort(). I then used "Macro > Load Module... F12" so that "util.e" would be recompiled and added to vslick.sta. I then triggered the function with "Tools > Sort...", but none of the added functions executed  ???
Even though it is explicitly discouraged, how do I change the behavior of macros in "c:\Program Files\SlickEdit Pro 22.0.0\macros" (with the intent of adding debug statements)?
Thanks in advance,
Pieter

Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
Re: Trying to debug slickedit macro with dsay()... "vs.log" not created
« Reply #3 on: September 28, 2017, 08:43:09 PM »
On windows 10 beta 3 I get an error "getCodehelpFlags" already defined as same or different type or something (on the status line), when I load util.e after adding a call to say.  Check in the installation macro folder to see if a new util.ex file is created.

I also use this command to force slick to re-compile the source file even if it hasn't changed.

_command void force_load() name_info(','VSARG2_REQUIRES_EDITORCTL|VSARG2_READ_ONLY)
{
   _save_file('+o');
   load();
}

If I want to make a permanent change to a slick C file I copy it to my configuration folder and load it from there.  When two files have the same name, slick uses whichever file was last loaded.  Function calls go through a thing called the names table so there is a kind of very late binding, allowing the newly loaded module to take over from the previous one (watch out for function pointers/ timer callbacks though).  Very useful.  If you make a permanent change you have to watch out for hotfixes replacing your modified version of a slick file.  I haven't used the slick c debugger for ages and last time I tried I remember it was a bit tricky but it should work.

pieterc

  • Community Member
  • Posts: 43
  • Hero Points: 3
Re: Trying to debug slickedit macro with dsay()... "vs.log" not created
« Reply #4 on: September 29, 2017, 08:47:30 AM »
Hi Graeme,
Thanks for the assist! I figured out that SlickEdit can't reload modules in the installed directory (c:\Program Files\SlickEdit Pro 22.0.0\macros), but if I load it from another (writable?) directory, e.g. c:\Temp, it works. That was sufficient for me, as I only needed to load and debug the modified modules (the changes don't need to be applied permanently).
Best regards,
Pieter
P.S. The Slick-C debugger worked beautifully for me and helped me to pinpoint the problem  ;D