Author Topic: Providing feedback in a Macro Form from running script  (Read 3222 times)

radensb

  • Community Member
  • Posts: 5
  • Hero Points: 0
Providing feedback in a Macro Form from running script
« on: September 13, 2013, 06:38:53 PM »
Hi all. I wrote a macro that executes a script based on some parameters that the user selects in the macro form. I want to be able to provide some feedback in the macro form as to the state of the scripts execution. Using the concur_command() function, I am able to queue up the command and see its output in the build window. My thought was to have my script create a "status file" that would output status information updates as the script ran and completed certain tasks. Something like:

<status_file.txt>
Running program A...
Program A complete.
Running program B...
Program B complete.

What I would need is a way to trigger a function or command in my macro to read the last line in this file when it gets modified and use it to update some feedback controls in the form.

Any ideas how to do this?

My first thought was to create a polling command that checked the status file periodically, but that sounds like a shady way to do it and I could not figure out how that would work in slick C. I need a solution that is self contained contained in the macro itself.

Thanks!

Graeme

  • Senior Community Member
  • Posts: 2793
  • Hero Points: 347
Re: Providing feedback in a Macro Form from running script
« Reply #1 on: September 15, 2013, 10:59:08 PM »
One possibility is to get your script to "callback" slickedit just with
vs.exe  "-# process_feedback ..."
and write a macro called process_feedback
_command void process_feedback(_str next_line)
{
   // ... write line to an editor control
}

You can also use a timer to monitor the text file the script generates

   timer_handle = _set_timer(1000,timer_callback);
//...
static void timer_callback()
{
}
//...
   _kill_timer(timer_handle);

Also on Windows, Slickedit supports DDE - see the help.