Author Topic: How do I get a file without any extension recognized by SlickEdit as a C file ?  (Read 18806 times)

hs2

  • Senior Community Member
  • Posts: 2752
  • Hero Points: 291
You could use the 'fileman' to repeat an 'add-extless' command on a whole file list.
This could help a bit.
Example:
Code: [Select]
// fileman command to add MANY extless files
_str def_user_langext_files;
void add_extless ( _str file )
{
   if ( !pos ('(^|:b)'file'(:b|$)', def_user_langext_files, 1, 'R') )
      def_user_langext_files :+= file :+ ' ';
   _config_modify_flags(CFGMODIFY_DEFDATA);
}

Change the dir and invoke 'fileman' on cmdline or 'File>File Manager' and use the context menu to 'Select all' and 'Repeat Command' (e.g. add-extless %n).
You'd only need to add the include directories as already described manually.

Edit: avoid duplicates added
HS2
« Last Edit: December 13, 2007, 09:43:48 pm by hs2 »

spowers

  • Community Member
  • Posts: 46
  • Hero Points: 0
you'll have to forgive me as I'm new to slickedit... but what exactly do I do with this code snippet??

hs2

  • Senior Community Member
  • Posts: 2752
  • Hero Points: 291
You could add it to your user macro file '<path-to-config-dir>\config\vusrmacs.e' if existing (or use the attached example containing the 'add_extless' macro function). After that you can 'Macro>Load Module: vusrmacs.e' to add the function as a new one to SE. After that you can use it with fileman as described.
Hope it's a bit more understandable. If there is sth. missing just ask...
(see 'Help > About' where your config dir resides)
HS2

BTW: It's also worth to check the help howto do things like that as it's a key feature to get most out of SE.
See 'Help>Contents>Slick-C® Macro Programming Guide: e.g. Four Ways to Use Slick-C®'.


« Last Edit: December 16, 2007, 10:37:27 am by hs2 »

spowers

  • Community Member
  • Posts: 46
  • Hero Points: 0
When I try to load that module I get an invalid expression. I'm using slick edit 11.0.2

hs2

  • Senior Community Member
  • Posts: 2752
  • Hero Points: 291
Hmm - try to change 
Code: [Select]
      def_user_langext_files :+= file :+ ' ';to
Code: [Select]
strappend ( def_user_langext_files, file ' ' );HS2