Microsoft Knowledge Base |
|
BUG: Notification Fails to Work with STOP, FAIL, and END |
|
|
Last reviewed: January 10, 1997
Article ID: Q156761 |
|
The information in this article applies to:
SYMPTOMSNotifications do not work more than once if a STOP, FAIL, or END statement is executed in the notification handler routine.
CAUSENotifications provide the ability to detect (trap) and respond to a variety of events such as Keystrokes, Window creation, and Window destruction. A notification handler routine gets called every time the corresponding defined event occurs. For example, if the user has implemented a notification handler for a desired keystroke, the script will detect when that key is pressed and will respond by executing the designated code. Notification stops working if a STOP, FAIL, or END statement is executed in its handler routine.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft product listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe following sample code demonstrates the above-mentioned problem using the Keypress notification.
Steps to Reproduce ProblemCreate a script with the following code:
'$include 'declares.inc'
'Turn the KeyPress notification on - execute KeyPressHandler routine
'when CTRL+C press is detected.
On KeyPress ("C", FCONTROL) Call KeyPressHandler
Viewport Clear
Sleep 60
End
'Notification handler subroutine definitions. Every time you press
'CTRL+C, the following sub routine will get called:
Sub KeyPressHandler(vtNotifyData as Variant)
static count as long
count = count +1
'Print to the viewport that the handler got called
Print("KeyPress handler called ");
Print("No. of times called: "),count
'The following line is the one mentioned in step 7
'stop
End Sub
Desired Functionality
To Cause Failure
Restoring NotificationsTo get the notification to work again, you must exit and restart Developer Studio. Then comment out the STOP statement in the error handler before running the script.
REFERENCESFor more information on Notifications, please refer to the Visual Test Online Help under:
Visual Test 4.0 Books Online
\ Programmer's Guide
\ Handling Errors and events
\ Notifications
Visual Test 4.0 Books Online
\ Knowledge Base Articles
\ How to Use Notifications in the Test Language
|
|
KBCategory: kbusage kbbuglist
©1997 Microsoft Corporation. All rights reserved. Legal Notices. |