Author Topic: _mffind has fallen in love with one of my files  (Read 3953 times)

MindprisM

  • Senior Community Member
  • Posts: 127
  • Hero Points: 8
_mffind has fallen in love with one of my files
« on: April 19, 2009, 12:45:52 PM »
I have a function defined in vusrmacs.e, when the fn calls:
_mffind2(s,'I','<Workspace>','*.*','','96','0');

I get a messagebox popup saying 'Cant find module __colorb.e', then it continues with the find normally.

__colorb.e is one of my modules, which isn't loaded, but the results are the same if I do load it.

I thought this was caused by <bad path>\__colorb.e being in one of my workspace project files, but it is not.

It seems to want __colorb.e to be in my current working dir, and when I put it there, it compiles it, but doesn't load it. And the Message doesnt appear.

Perhaps Slickedit has lost its path for modules. But for the life of me I can't figure out where this __colorb.e reference is being invoked.

Heres the wierd part, I was using a function 'to_int' in __color.e in vusrmacs.e, and __color.e has autoload code to load __colorb.e, but I disconnected the autoload, and unloaded both color modules, recompiled vusrmacs.e and I get the expected error on the function call.

So where is this colorb.e reference coming from, and why is _mffind2 triggering a module compile?

Ive traced _mffind2  out and found that the Message Box is coming from bgsearch.e in start_bgsearch() at line:

bgm_proc_handle=_PipeProcess(maybe_quote_filename(editor_name("E")):+' +new':+lock_option:+' -q -st 0 -mdihide -r bgsearch',bgm_hin,bgm_hout,bgm_herr,'');

Ive checked my vusrobjs.e and vusrdefs.e for 'colorb' and no joy.
================================================
I just resolved this by restarting vs with __color.ex and __colorb.ex unloaded.

So it seems the .sta file doesn't really unload modules the way one would think.

Regardless, whats a good way to check the path components of vs.exe -- I think this is still my issue in the long run.

------------------------------
The root of my problem seems to be that <macros>/__colorb.e wasn't compiled, and my autoload code works like:
Code: [Select]
//__color.e
 _str __color_depends[]={"__osh","__colorb"};

 definit()
  {
    load_modules("__color");
  }

//__10.e (root functions)
int load_modules(a)
{
   if (arg()==0) {return (0);}
   //dep=null;
   f=1;

   //_message_box(a._varformat());
   //Msg(a._varformat());
   if (a._varformat()==VF_EMPTY||a._varformat()==VF_ARRAY) {
      dep=a;
      //_message_box(dep._varformat());
      f=0;
   }
   if (a._varformat()==VF_LSTR) {
      //Msg('load_modules:1');
      i=find_index(a '_depends',VAR_TYPE);
      if (!i) {return (0);}
      //Msg('load_modules:2');
      dep=_get_var(i);
      //Msg(array2str(dep));
      f=0;
   }
   if (f) {return (0);}
   for (x=0;x<dep._length();x++) {
      //_message_box(dep._el(x));
      if (1) {
         i=find_index(dep._el(x) '.ex',MODULE_TYPE);
         if (i==0) {
            //_message_box('loading:' dep._el(x));
            if (dep._el(x)!="") {
               load(SLICKEDITMACRODIR dep._el(x) '.e');
            }
         }
      }
   }
   return (0);
}


Anyhow, I think the autoload code is correct in using definit, so maybe this is usefult snippet for someone.