Author Topic: writing a post build callback  (Read 5812 times)

gary_ash

  • Guest
writing a post build callback
« on: November 03, 2006, 05:51:37 PM »
Hi,

I'd like to create a postbuild callback function that will scan the process buffer and if no errors occurred during the build  switch back to the Symbols window. Has anyone done anything like this yet? also it possible to beep the speaker or something at the end of the build?

thanks

gb

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: writing a post build callback
« Reply #1 on: November 03, 2006, 07:03:43 PM »
On the Project Properties->Tools tab there is a "Beep on Completion" checkbox...

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: writing a post build callback
« Reply #2 on: November 04, 2006, 09:56:00 AM »
@gary_ash: Good idea !
Maybe you should wait for the next patch/release. The Slickteam stated that the pre/postbuild stuff is/will be reworked.
@see: http://community.slickedit.com/index.php?topic=524.msg2225#msg2225

HS2

gary_ash

  • Guest
Re: writing a post build callback
« Reply #3 on: November 06, 2006, 12:26:21 AM »
Hi,

I was able to whip this up pretty quick and decided to post it in case anyone else cares.

#include "slick.sh"

_postbuild_GarBob()
    {
    _beep();
    int status = next_error();
    if (status == 0 || status == STRING_NOT_FOUND_RC)
        {
        toggle_symbol();
        toggle_symbol();
        }
    }

This callback sounds a bop on the computer and then toggles the active tab on bottom window back to the symbol tab if there weren't any errors in the build. If there were are errors slickedit is ready to edit at the first one

gb

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: writing a post build callback
« Reply #4 on: November 06, 2006, 02:05:35 PM »
I was going to respond to this, but you have already found the correct callback. _postbuild_ callback functions are executed upon completion of builds when they done through the vsbuild system.  Just note that some project tools are not executed through vsbuild, and you do not get _postbuild_ callbacks.

As mentioned previously, "Beep on Completion" is available through Project Properties.

gary_ash

  • Guest
Re: writing a post build callback
« Reply #5 on: November 06, 2006, 03:42:21 PM »
Thanks for the warning. This little callback routine seems to be working rather nicely for anyway

gb