Advanced PowerBuilder

HomePrevious Lesson: MessageBox()
Next Lesson: Messages

KeyDown(), GetObjectAtPointer()

When debugging, using the KeyDown() and GetObjectAtPointer() functions pose a problem. When debugging, the debug window is the active window and is placed in the front. During step-by-step execution, the key pressed is sent to the active window i.e., the debug rather than the active window in the application.

The solution to this problem is to set Stop Points above and below the line containing the KeyDown() function, and once the first Stop Point above the KeyDown() function is reached, select the Continue icon instead of the step icon. This allows the pressed key to be passed to the active window in the application, and the execution stops at the next Stop Point, i.e., after the KeyDown() function.

Do the same with GetObjectAtPointer().
HomePrevious Lesson: MessageBox()
Next Lesson: Messages