ARIA-Users

Date Index Thread Index

Re: [Aria-users] how to print data before Escape



Firman Wahyudi wrote:
> i want to make program that will print data to file before program exit. 
> I use ArKeyHandler to make program exit when i press ESC..
> Where should I call the printToFile function so that program write to 
> file first before it exit.

ArKeyHandler uses Aria::exit() to exit the program. Before exiting, Aria::exit() 
calls some callback functions. You can register these callback functions with 
the static Aria::addExitCallback() method.

Another way is to call your function in the destructor of an instantiated 
object, this is useful if you happen to be using a class to encapsulate your 
file printing behavior.

Reed