Author Topic: Reporting compilation success back to SlickEdit?  (Read 4294 times)

FullyArticulate

  • Community Member
  • Posts: 21
  • Hero Points: 4
Reporting compilation success back to SlickEdit?
« on: January 09, 2008, 08:23:18 pm »
Does anyone have a way of getting the success or failure of a compilation attempt back to SlickEdit? I'd like the compile window to popup when I compile, but then go away if the compilation was successful (the exit code from make was 0 or some such).

Thanks!

Graeme

  • Senior Community Member
  • Posts: 2638
  • Hero Points: 330
Re: Reporting compilation success back to SlickEdit?
« Reply #1 on: January 11, 2008, 11:30:23 pm »
Does anyone have a way of getting the success or failure of a compilation attempt back to SlickEdit? I'd like the compile window to popup when I compile, but then go away if the compilation was successful (the exit code from make was 0 or some such).

Thanks!


I guess when you say "compile window" you mean the build window.  You could try using the pre-build and post-build commands  - a pre-build command could set a flag "my_build_is_active" to one and the post build command could set it back to zero.  The post build command "might" be able to close the build window if there were no errors, or you could fire up a monitoring process run from a timer interrupt with the pre build command that checked when "my_build_is_active" had gone to zero (the post build command would set it to zero).

To find out if there were no errors, you might be able to use the next_error command - it should return zero only if it successfully displayed the next error.  Another possibility is to call a slick macro from your external build tool to set or clear a flag  - the command would look something like this
vs.exe -new "-# my_build_result 0"
if the build was successful
where my_build_result is your own macro that accepts one parameter indicating success or failure.
You could also try setting an environment variable in your external build tool indicating success or failure and use the slick macro function get_env  - but I'm not sure if slick can access an environment variable like that.

Graeme

hs2

  • Senior Community Member
  • Posts: 2752
  • Hero Points: 291
Re: Reporting compilation success back to SlickEdit?
« Reply #2 on: January 12, 2008, 11:20:12 am »
You could use the deprecated external Slick-command callback mechanism for the time being.
But it's expected that the build system is changed in v13 coming soon.
By using the ext. callback method you can 'inject' a SE command call from an external batch script or makefile which was invoked as concurrent (build) command in SE. The command is called in the same way as if it'd be invoked on SE commandline.
This means you can call a macro command along with commands forwarded to the OS shell like 'del', 'mkdir' etc.
Have a look at the attached example and maybe here http://community.slickedit.com/index.php?topic=819.msg4226#msg4226
in case you don't want to wait.
Again, I expect this won't be supported for SE >= v13 b/c it's an undocumented and dangerous/unsafe method (see http://community.slickedit.com/index.php?topic=1807.msg7672#msg7672)

HS2
« Last Edit: January 15, 2008, 02:07:06 am by hs2 »

FullyArticulate

  • Community Member
  • Posts: 21
  • Hero Points: 4
Re: Reporting compilation success back to SlickEdit?
« Reply #3 on: January 15, 2008, 12:59:41 am »
Thanks for the pointers, as soon as I get some free time, I'll take a crack at this!