Skip to main content

What I am trying to accomplish (unsuccessfully so far) is that if the end-user starts the process to generate a report, and they realize it is going to take a long time, I want to provide them a "kill" button.  The kill button would post a message to the report and tell it to stop.

What happens with my test

               Form 1 – select a report

Activates the window with the "kill" button

                        Then Actives a form for the user to filter the report data (Form 2)

                Form 2 – select "print" button, activates report

                         Cursor spins until the report finishes

                         Report finishes and then I can go back to the "kill" windows, but by now it is too late

 Once they select the print button … I want them to be able to go to the "kill" button form BUT this is not possible until the report finishes

 I understand the logic behind the way it works.  I'm just looking for a "work around" 😊

My early prototype worked, but that's because both of the forms popped up interactive windows, which a report does not.

Thanks for any ideas!

J. DeTurk



------------------------------
Joanne DeTurk
Software Manager
Mirion Technologies (Canberra), Inc.
------------------------------

What I am trying to accomplish (unsuccessfully so far) is that if the end-user starts the process to generate a report, and they realize it is going to take a long time, I want to provide them a "kill" button.  The kill button would post a message to the report and tell it to stop.

What happens with my test

               Form 1 – select a report

Activates the window with the "kill" button

                        Then Actives a form for the user to filter the report data (Form 2)

                Form 2 – select "print" button, activates report

                         Cursor spins until the report finishes

                         Report finishes and then I can go back to the "kill" windows, but by now it is too late

 Once they select the print button … I want them to be able to go to the "kill" button form BUT this is not possible until the report finishes

 I understand the logic behind the way it works.  I'm just looking for a "work around" 😊

My early prototype worked, but that's because both of the forms popped up interactive windows, which a report does not.

Thanks for any ideas!

J. DeTurk



------------------------------
Joanne DeTurk
Software Manager
Mirion Technologies (Canberra), Inc.
------------------------------

So, this is because the report is (of necessity) modal/synchronous. You can't do async processing in the same copy of uniface as sync processing.  

There is a (rather cludgy) 'workaround' for this. 

You have to start a new copy of uniface, with a startup shell which accepts at least one parameter and runs that report component.  So it is effectively running a separate report. 

The kill button then works one of two ways. 

  1. Before starting the new uniface with the report, you write to a file in the database a token that you are waiting for the report output. The report then periodically (every occurrence? Every other occurrence?) checks the record exists, and exits if not. The kill button simply deletes the record. (As does the cleanup operation in Form A, so the token goes away if the user simply closes the program). 
  2. The same idea but the other way around, the kill button writes a token to say abort, and the report checks periodically for the token and aborts if found. 

Using the database token file as a link, it should be possible to write progress statements back to  FORM A, and have it check (using UTIMER) every so often to update the progress of the report for the user. 

Regards, 

Iain



------------------------------
Iain Sharp
Head of Technical Services
Jonas Metals Software Limited
Sheffield GB
------------------------------

So, this is because the report is (of necessity) modal/synchronous. You can't do async processing in the same copy of uniface as sync processing.  

There is a (rather cludgy) 'workaround' for this. 

You have to start a new copy of uniface, with a startup shell which accepts at least one parameter and runs that report component.  So it is effectively running a separate report. 

The kill button then works one of two ways. 

  1. Before starting the new uniface with the report, you write to a file in the database a token that you are waiting for the report output. The report then periodically (every occurrence? Every other occurrence?) checks the record exists, and exits if not. The kill button simply deletes the record. (As does the cleanup operation in Form A, so the token goes away if the user simply closes the program). 
  2. The same idea but the other way around, the kill button writes a token to say abort, and the report checks periodically for the token and aborts if found. 

Using the database token file as a link, it should be possible to write progress statements back to  FORM A, and have it check (using UTIMER) every so often to update the progress of the report for the user. 

Regards, 

Iain



------------------------------
Iain Sharp
Head of Technical Services
Jonas Metals Software Limited
Sheffield GB
------------------------------

Using the token file as a list, it should be possible to have the user start several reports, with the report deleting the token on completion, and then have a 'management screen' as per the windows spooler which allows the user to abort the running job(s). You would then choose whether the reports were run in multiple copies of uniface concurrently, or if the second copy looped through the tokens list to run them consecutivelly. 
It's a lot of faffing, but it could come up with something smooth from the user's point of view. 



------------------------------
Iain Sharp
Head of Technical Services
Jonas Metals Software Limited
Sheffield GB
------------------------------

What I am trying to accomplish (unsuccessfully so far) is that if the end-user starts the process to generate a report, and they realize it is going to take a long time, I want to provide them a "kill" button.  The kill button would post a message to the report and tell it to stop.

What happens with my test

               Form 1 – select a report

Activates the window with the "kill" button

                        Then Actives a form for the user to filter the report data (Form 2)

                Form 2 – select "print" button, activates report

                         Cursor spins until the report finishes

                         Report finishes and then I can go back to the "kill" windows, but by now it is too late

 Once they select the print button … I want them to be able to go to the "kill" button form BUT this is not possible until the report finishes

 I understand the logic behind the way it works.  I'm just looking for a "work around" 😊

My early prototype worked, but that's because both of the forms popped up interactive windows, which a report does not.

Thanks for any ideas!

J. DeTurk



------------------------------
Joanne DeTurk
Software Manager
Mirion Technologies (Canberra), Inc.
------------------------------

Hi Joanne
Nope, it is not possible to interrupt UnifAce when it is running, not even by an async-message from outside.
UnifAce test input queues only if it is in "idle" state.
BUT ...
1) But you can implemant a short globale procedure which in turn calls a small component that reads a table in the database
    The key should somtinge like a session id so all your clerks can user ist and doesnt not influence each other
    And there should a field: "Abort" (boolean)
    On start on you report fill "Abort"-Field with "False"
    In the report an every "row" call they global procedure, read the special table table by session ID and if "Abort" is True, return -9999 and stop the report
    Now implement a second UnifAce application (or other languages) with a simple button. Presse the button and the write True in to "Abort"

2) Write a simple DLL (e.g. VisualBasic) whith a button. This DLL should have a few C-interfaces like INIT, STOP, CHECK
    With INIT create the simple surface with a button. The surface should be visbale until STOP
    Now call the DLL from the report on every row with CHECK
    If the clerck press the button, remembers this by a variable in the DLL
    With CHECK return the content of this variable like  1=Runnig,0=Abort

Just two ideas  :-)

Ingo   



------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------

Hi Joanne
Nope, it is not possible to interrupt UnifAce when it is running, not even by an async-message from outside.
UnifAce test input queues only if it is in "idle" state.
BUT ...
1) But you can implemant a short globale procedure which in turn calls a small component that reads a table in the database
    The key should somtinge like a session id so all your clerks can user ist and doesnt not influence each other
    And there should a field: "Abort" (boolean)
    On start on you report fill "Abort"-Field with "False"
    In the report an every "row" call they global procedure, read the special table table by session ID and if "Abort" is True, return -9999 and stop the report
    Now implement a second UnifAce application (or other languages) with a simple button. Presse the button and the write True in to "Abort"

2) Write a simple DLL (e.g. VisualBasic) whith a button. This DLL should have a few C-interfaces like INIT, STOP, CHECK
    With INIT create the simple surface with a button. The surface should be visbale until STOP
    Now call the DLL from the report on every row with CHECK
    If the clerck press the button, remembers this by a variable in the DLL
    With CHECK return the content of this variable like  1=Runnig,0=Abort

Just two ideas  :-)

Ingo   



------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------

BTW Long time ago (1986) , we did programming on a MAI Basic/four "mainframe"
Here is a document with the programm language
https://bitsavers.org/pdf/mai/M6262A_Business_Basic86_RefenceManual_Apr87.pdf
On page 4-93 the stamtement "SETESC"  is described
"SETESC causes the program to branch if ESCAPE is pressed. "The system executes a GOSUB to the line number specified in the SETESC statement. Following a RETURN, the system resumes processing at the point.from which the SETESC branch was taken."
This the Esacpe is the Kill-Button. Today in Uniface is could be like this
"ONESC call <a globale procedure>"
And somewhere is definded what the ESCAPE-Button should be




------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------