Author Topic: Can user-defined Slick-C macros consist of multiple macro files?  (Read 7005 times)

cappy2112

  • Community Member
  • Posts: 91
  • Hero Points: 0

I want to use more than one macro file, for my existing project.
One file will contain the main() function, and will invoke functions in the second file.
(I haven't seen any examples of this type of macro file architecture)

However, the second file will be generated by an external program.

What I don't understand how to do is call the functions in the second file, from the first file.
How will the Slick macro compiler know where to look to resolve the functions in the second file?

This situation is analogous to a multi- file C program, compiled & linked through a make file.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Can user-defined Slick-C macros consist of multiple macro files?
« Reply #1 on: June 20, 2007, 03:23:50 PM »
It's quite similar to a C program. Once both modules are loaded you're able to call (global) functions located in other modules.
Note that you could also #import "second_module.e" in your main module. Using this you only need to load your main_module.e (@see http://community.slickedit.com/index.php?topic=691.msg3045#msg3045)

HS2

cappy2112

  • Community Member
  • Posts: 91
  • Hero Points: 0
Re: Can user-defined Slick-C macros consist of multiple macro files?
« Reply #2 on: June 20, 2007, 05:27:22 PM »
It's quite similar to a C program. Once both modules are loaded you're able to call (global) functions located in other modules.
Note that you could also #import "second_module.e" in your main module. Using this you only need to load your main_module.e (@see http://community.slickedit.com/index.php?topic=691.msg3045#msg3045)

HS2

Great- I was speculating this would be the solution, but was thinking of # include instead of #import

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Can user-defined Slick-C macros consist of multiple macro files?
« Reply #3 on: June 20, 2007, 05:48:35 PM »
Oops - tried the great, new '#import' directive but it's not yet implemented in v12.0.1 :(
Sorry, but a number of the other lang-enhancements are already there.
I did't try all of them and unfortunately there is no status report from Dennis ;)

However, '#include' is working as known from C.

HS2

cappy2112

  • Community Member
  • Posts: 91
  • Hero Points: 0
Re: Can user-defined Slick-C macros consist of multiple macro files?
« Reply #4 on: June 20, 2007, 06:31:31 PM »
Oops - tried the great, new '#import' directive but it's not yet implemented in v12.0.1 :(
Sorry, but a number of the other lang-enhancements are already there.
I did't try all of them and unfortunately there is no status report from Dennis ;)

However, '#include' is working as known from C.

HS2

It sounds like you know the support staff well.

It would be great if they would release bug fixes separately from new features, to avoid adding more bugs than fixes in a given release. Actually, all software companies should do this.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Can user-defined Slick-C macros consist of multiple macro files?
« Reply #5 on: August 25, 2007, 01:22:40 AM »
Cool - #import (maybe more) is supported in v12.03 !
HS2