Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dialogbox

Status
Not open for further replies.

iSDX

Technical User
Jul 24, 2002
64
AU
Is it possible to display a dialogbox and let the script run in the background and
to have the option to exit the script with a pushbutton. The reason I want the
dialogue box displayed, is because I would like the menu bar and options are disabled when the dialogue box is active . Basically to stop people messing around when the script is running and to notify the user that the script may take some time .



here is what I have tried.

dialogbox 2 60 45 332 169 139 "Diversion Program"
text 1 68 30 156 19 "Please wait while the iSDX searches for DIVersions." left
text 2 66 62 150 21 "This may take some time depending on the amount of extensions on the system." left
pushbutton 3 102 131 84 13 "Cancel the Script" CANCEL default
text 4 74 99 122 19 "If the CANCEL button is selected the script will abort and all data will be lost." left
enddialog


dlgevent 2 Event ; Read dialog event.
switch Event ; Evaluate dialog event.
case 3
Termreset
Txflush
RXflush
exit ;exit the script

endcase
endswitch

while

Get data from the pabx etc

endwhile

dlgdestroy 2 CANCEL ; Get rid of dialog box no 2 if user hasn't cancelled already

continue with script




 
The Answer to your Question is YES. Are you Receiving or Sending Data or Both ?
Do you really need 2 Dialog Box Menu's or Just One ?
What Type of Connection are you Making ? ( Modem / Direct Connect )

Let me Know and Maybe I can put a Model together for you.

Hank
 
In relation to the data : data will be sent and recieved.

No of dialogboxes : only one is required when sending and recieving the data, I have a dialogbox at the start of the script with text information, a continue button or exit. Thats why the dialogbox is named 2 , above. Once the data is stored I intend to display another dialogbox basically giving the option to save the data recieved or to send it back to the PABX.

Type of connection : can be modem/direct connect/telnet

Thank you

iSDX

 

Hank,
You said this was possible could you guide me in the right direction,
I'm a bit lost at the moment.

Regards,

iSDX.

 
If you just want the dialogbox displayed so people don't mess with Procomm's UI, you can use the disable and enable commands to turn off various Procomm menus. If you look at the file pw5menu.inc in your ASPECT directory, you can see the menu IDs of the various menus in Procomm.
aspect@aspectscripting.com
 
Thanks Knob,

I tried the disable function and it works great.


If the "Start/Stop script" button on the PW4 menu
is selected can you detect this and issue some commands
before terminating the script.

I have the problem if the script is Stopped the buffer
writes to the screen. I would like to flush the buffer and
reset the terminal before stopping.

Regards

iSDX.
 
Yep, if you use the when userexit command, you can call a script that performs cleanup and then exits the script. Here's the discussion of this command from the ASPECT help file:

USEREXIT call procedure when the user presses the Script halt button on the Action Bar or selects Script | Stop Script command. This allows the script to branch to a "cleanup" procedure before it terminates. If the script issues the statement set aspect control on, the USEREXIT procedure will not be called.

The called procedure must issue an exit or halt command to terminate the script. Otherwise the script will not terminate.

Here's a quick and dirty example I whipped up to show the format of the command:

proc main
when userexit call close_down

while 1
yield
endwhile
endproc

proc close_down
usermsg "Script closing!"
pause 3
exit
endproc

The script will sit in an endless loop until someone clicks on the Start/Stop Script button. When that happens, the close_down procedure is called and the exit command closes the script.
aspect@aspectscripting.com
 
Thanks Knob,

Just tried the when command, the script is working well now

Thanks again for your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top