AnsweredAssumed Answered

VRf - OK with F-Keys?

Question asked by VRFuser on May 19, 1997
From:     mike.groves@ericsson.com
To:       Vee Reflector
Subject:  Problems with using F-Keys with OK buttons
Platform: HP Vectra Pentium, VEE 4.0

Ok guys, I see you've worked a little on the OK with Function Key
problems, but they ain't fixed entirely yet.

Here's a problem described using VEE 4.0 (3.x and 2.x act similar):
In the simple program below, I have in the Main Box 5 OK buttons
assigned to the function keys F1-F5.  F1 and F2 don't do anything
except loop back.  F3 starts UserObject "Sub-1" executing.  F4 will
generate a User Error and F5 stops the loop, and the program.

In the UserObject Sub-1, I have 4 more OK buttons assigned to F2-F5.
F2 and F4 should do nothing except loop back.  F3 breaks the loop
and exits.  F5 executes an "Exit UserObject" command.

Arrange the Main and Sub-1 boxes so you can see them both on the
screen at the same time.  Start the program running.  USING A
MOUSE, hit the F1 and F2 buttons in the Main box.  Now click on the
F3 button.  Move your mouse to the Sub-1 box and click on F2 and
F4 a while.  Now try F3 or F5 to get back to the Main box.

So what's the problem, you ask?  Go back and try the exact same
thing only NOW using the keyboard.  If your computer acts like mine,
by pressing a single function key while in Sub-1, you execute
BOTH the Main and Sub-1 threads for that function key, and the
Sub-1 thread is terminated.  If you press F1 while in Sub-1, the
thread in Sub-1 is terminated and you are returned to Main.

This can be a real problem if say in your Main program you assigned
F1 to activate a HELP routine and sometime later, deep in a nested
subroutine or function, someone hits the F1 key and ends up
back on the Main thread, never to return to what he was doing.

The other problem it poses is never being able to assign the
Function Keys to more than one task.  If the user presses the key
instead of clicking on it with a mouse, who knows how many "old"
F-Key assignments will spring into action at the same time.

Thanks for listening to me rant,
Mike Groves

Program:
------------------------------------------------------------------

(saveFormat "2.3")
(date "Mon 19/May/1997 19:31:16 ")
(veerev "4.0")
(platform "PC")
(execMode fast)
(filterNAN 0)
(workspaceStackingOrder M M.33)
(SaveCF no)
(device 0 ROOTCONTEXT
(properties
(trigMode deg)
(nextID 42)
(popupTitleText "Untitled")
(popupMoveable 1)
(deleteGlobals 0))
(deviceList
(device 5 REPEATUNTILBREAK
(interface
(output 1
(name "Continuous")
(lock name constraints))))
(device 6 CONFIRM25
(properties
(name "F1: OK ")
(enterButton 0)
(escapeButton 0)
(isAssigned2FKey F1))
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(device 15 CONFIRM25
(properties
(name "F2: OK ")
(enterButton 0)
(escapeButton 0)
(isAssigned2FKey F2))
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(device 22 LITERALCONSTANT
(properties
(name ""F1""))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  "F1"))
(initValue Text
(data  ""))))
(device 23 LITERALCONSTANT
(properties
(name ""F2""))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  "F2"))
(initValue Text
(data  ""))))
(device 25 START25)
(device 26 NEXT)
(device 27 NEXT)
(device 29 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 30 JUNCTION
(properties
(name "JCT"))
(interface
(input 1
(name "A")
(lock name constraints))
(input 2
(name "B")
(lock name constraints))
(input 3
(name "C")
(optional yes))
(input 4
(name "D")
(optional yes))
(input 5
(name "E")
(optional yes))
(output 1
(name "Data"))))
(device 31 CONFIRM25
(properties
(name "F4: OK ")
(enterButton 0)
(escapeButton 0)
(isAssigned2FKey F4))
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(device 32 ESCAPE
(properties
(errorCode 666)
(message "F4 in Main was tripped!")))
(device 33 CONTEXT
(properties
(name "Sub-1")
(trigMode deg)
(nextID 40)
(popupTitleText "UserObject")
(popupMoveable 1))
(deviceList
(device 15 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 16 JUNCTION
(properties
(name "JCT"))
(interface
(input 1
(name "A")
(lock name constraints))
(input 2
(name "B")
(lock name constraints))
(input 3
(name "C")
(optional yes))
(input 4
(name "D")
(optional yes))
(output 1
(name "Data"))))
(device 18 LITERALCONSTANT
(properties
(name ""F5""))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  "F5"))
(initValue Text
(data  ""))))
(device 19 CONFIRM25
(properties
(name "F5: OK ")
(enterButton 0)
(escapeButton 0)
(isAssigned2FKey F5))
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(device 21 LITERALCONSTANT
(properties
(name ""F4""))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  "F4"))
(initValue Text
(data  ""))))
(device 22 CONFIRM25
(properties
(name "F4: OK ")
(enterButton 0)
(escapeButton 0)
(isAssigned2FKey F4))
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(device 25 LITERALCONSTANT
(properties
(name ""F3""))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  "F3"))
(initValue Text
(data  ""))))
(device 26 CONFIRM25
(properties
(name "F3: OK ")
(enterButton 0)
(escapeButton 0)
(isAssigned2FKey F3))
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(device 27 NEXT)
(device 28 LITERALCONSTANT
(properties
(name ""F2""))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  "F2"))
(initValue Text
(data  ""))))
(device 29 CONFIRM25
(properties
(name "F2: OK ")
(enterButton 0)
(escapeButton 0)
(isAssigned2FKey F2))
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(device 34 REPEATUNTILBREAK
(interface
(output 1
(name "Continuous")
(lock name constraints))))
(device 35 BREAK)
(device 36 EXITCONTEXT
(properties
(name "Exit")))
(device 39 NEXT)
(configuration
(connect D1:1 D0:1)
(connect D2:1 D1:1)
(connect D4:1 D1:2)
(connect D6:1 D1:3)
(connect D9:1 D1:4)
(connect D3:0 D2:0)
(connect D11:1 D3:0)
(connect D5:0 D4:0)
(connect D11:1 D5:0)
(connect D7:0 D6:0)
(connect D11:1 D7:0)
(connect D9:0 D8:0)
(connect D10:0 D9:0)
(connect D11:1 D10:0)
(connect D6:0 D12:0)
(connect D2:0 D13:0)
(connect D4:0 D14:0)))
(contextCarrier
(wndOrigin 5 313)
(wndState res)
(active detail)
(detail
(extent 752 311)
(anchorPt -31 -112)
(configuration
(devCarrierFor 15
(active open)
(icon)
(open
(extent 122 29))
(pinCenter 700 330))
(devCarrierFor 16
(active icon)
(icon
(extent 29 54))
(open)
(terminals on)
(pinCenter 610 330))
(devCarrierFor 18
(active icon)
(icon
(extent 31 16))
(open
(extent 77 32))
(pinCenter 530 260))
(devCarrierFor 19
(active open)
(icon
(extent 53 0))
(open
(extent 52 23))
(title off)
(pinCenter 530 230))
(devCarrierFor 21
(active icon)
(icon
(extent 31 16))
(open
(extent 77 32))
(pinCenter 420 260))
(devCarrierFor 22
(active open)
(icon
(extent 53 0))
(open
(extent 52 23))
(title off)
(pinCenter 420 230))
(devCarrierFor 25
(active icon)
(icon
(extent 31 16))
(open
(extent 77 32))
(pinCenter 320 260))
(devCarrierFor 26
(active open)
(icon
(extent 53 0))
(open
(extent 52 23))
(title off)
(pinCenter 320 230))
(devCarrierFor 27
(active icon)
(icon
(extent 31 16))
(open)
(terminals on)
(pinCenter 220 290))
(devCarrierFor 28
(active icon)
(icon
(extent 31 16))
(open
(extent 77 32))
(pinCenter 220 260))
(devCarrierFor 29
(active open)
(icon
(extent 53 0))
(open
(extent 52 23))
(title off)
(pinCenter 220 230))
(devCarrierFor 34
(active icon)
(icon
(extent 74 52)
(iconImage "loop.icn"))
(open)
(terminals on)
(pinCenter 90 200))
(devCarrierFor 35
(active icon)
(icon
(extent 41 16))
(open)
(terminals on)
(pinCenter 320 290))
(devCarrierFor 36
(active icon)
(icon
(extent 26 16))
(open)
(terminals on)
(pinCenter 530 290))
(devCarrierFor 39
(active icon)
(icon
(extent 31 16))
(open)
(terminals on)
(pinCenter 420 290))
(connect D1:1 D0:1
(points 2 627 330 636 330))
(connect D2:1 D1:1
(points 4 548 260 570 260 570 310 593 310))
(connect D4:1 D1:2
(points 4 438 260 480 260 480 320 593 320))
(connect D6:1 D1:3
(points 4 338 260 360 260 360 330 593 330))
(connect D9:1 D1:4
(points 4 238 260 260 260 260 340 593 340))
(connect D3:0 D2:0
(points 2 530 244 530 249))
(connect D11:1 D3:0
(points 3 129 200 530 200 530 216))
(connect D5:0 D4:0
(points 2 420 244 420 249))
(connect D11:1 D5:0
(points 3 129 200 420 200 420 216))
(connect D7:0 D6:0
(points 2 320 244 320 249))
(connect D11:1 D7:0
(points 3 129 200 320 200 320 216))
(connect D9:0 D8:0
(points 2 220 270 220 279))
(connect D10:0 D9:0
(points 2 220 244 220 249))
(connect D11:1 D10:0
(points 3 129 200 220 200 220 216))
(connect D6:0 D12:0
(points 2 320 270 320 279))
(connect D2:0 D13:0
(points 2 530 270 530 279))
(connect D4:0 D14:0
(points 2 420 270 420 279)))
(stackingOrder 0 2 4 5 6 7 9 10 13 12 3 8 14 1 11))))
(device 35 CONFIRM25
(properties
(name "F3: OK ")
(enterButton 0)
(escapeButton 0)
(isAssigned2FKey F3))
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(device 36 NEXT)
(device 37 LITERALCONSTANT
(properties
(name ""F3""))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  "F3"))
(initValue Text
(data  ""))))
(device 38 LITERALCONSTANT
(properties
(name ""F4""))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  "F4"))
(initValue Text
(data  ""))))
(device 39 CONFIRM25
(properties
(name "F5: OK ")
(enterButton 0)
(escapeButton 0)
(isAssigned2FKey F5))
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(device 40 LITERALCONSTANT
(properties
(name ""F5""))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  "F5"))
(initValue Text
(data  ""))))
(device 41 BREAK)
(configuration
(connect D5:0 D0:0)
(connect D0:1 D1:0)
(connect D0:1 D2:0)
(connect D1:0 D3:0)
(connect D2:0 D4:0)
(connect D3:0 D6:0)
(connect D4:0 D7:0)
(connect D9:1 D8:1)
(connect D18:1 D9:1)
(connect D16:1 D9:2)
(connect D15:1 D9:3)
(connect D4:1 D9:4)
(connect D3:1 D9:5)
(connect D0:1 D10:0)
(connect D16:0 D11:0)
(connect D15:0 D12:0)
(connect D0:1 D13:0)
(connect D12:0 D14:0)
(connect D13:0 D15:0)
(connect D10:0 D16:0)
(connect D0:1 D17:0)
(connect D17:0 D18:0)
(connect D18:0 D19:0)))
(contextCarrier
(wndOrigin 4 3)
(wndState res)
(active detail)
(detail
(extent 810 279)
(anchorPt 45 61)
(configuration
(devCarrierFor 5
(active icon)
(icon
(extent 74 52)
(iconImage "loop.icn"))
(open)
(terminals on)
(pinCenter 20 20))
(devCarrierFor 6
(active open)
(icon
(extent 53 0))
(open
(extent 52 23))
(title off)
(pinCenter 100 50))
(devCarrierFor 15
(active open)
(icon
(extent 53 0))
(open
(extent 52 23))
(title off)
(pinCenter 200 50))
(devCarrierFor 22
(active icon)
(icon
(extent 31 16))
(open
(extent 194 30))
(pinCenter 100 80))
(devCarrierFor 23
(active icon)
(icon
(extent 31 16))
(open
(extent 77 32))
(pinCenter 200 80))
(devCarrierFor 25
(active open)
(icon)
(open
(extent 52 23))
(title off)
(pinCenter 20 -30))
(devCarrierFor 26
(active icon)
(icon
(extent 31 16))
(open)
(terminals on)
(pinCenter 100 110))
(devCarrierFor 27
(active icon)
(icon
(extent 31 16))
(open)
(terminals on)
(pinCenter 200 110))
(devCarrierFor 29
(active open)
(icon)
(open
(extent 122 29))
(pinCenter 680 150))
(devCarrierFor 30
(active icon)
(icon
(extent 29 54))
(open)
(terminals on)
(pinCenter 590 150))
(devCarrierFor 31
(active open)
(icon
(extent 53 0))
(open
(extent 52 23))
(title off)
(pinCenter 400 50))
(devCarrierFor 32
(active icon)
(icon
(extent 79 16))
(open
(extent 238 57))
(pinCenter 400 110))
(devCarrierFor 33
(active icon)
(icon
(extent 42 16))
(pinCenter 300 110))
(devCarrierFor 35
(active open)
(icon
(extent 53 0))
(open
(extent 52 23))
(title off)
(pinCenter 300 50))
(devCarrierFor 36
(active icon)
(icon
(extent 31 16))
(open)
(terminals on)
(pinCenter 300 140))
(devCarrierFor 37
(active icon)
(icon
(extent 31 16))
(open
(extent 77 32))
(pinCenter 300 80))
(devCarrierFor 38
(active icon)
(icon
(extent 31 16))
(open
(extent 77 32))
(pinCenter 400 80))
(devCarrierFor 39
(active open)
(icon
(extent 53 0))
(open
(extent 52 23))
(title off)
(pinCenter 510 50))
(devCarrierFor 40
(active icon)
(icon
(extent 31 16))
(open
(extent 77 32))
(pinCenter 510 80))
(devCarrierFor 41
(active icon)
(icon
(extent 41 16))
(open)
(terminals on)
(pinCenter 510 110))
(connect D5:0 D0:0
(points 2 20 -16 20 -9))
(connect D0:1 D1:0
(points 3 59 20 100 20 100 36))
(connect D0:1 D2:0
(points 3 59 20 200 20 200 36))
(connect D1:0 D3:0
(points 2 100 64 100 69))
(connect D2:0 D4:0
(points 2 200 64 200 69))
(connect D3:0 D6:0
(points 2 100 90 100 99))
(connect D4:0 D7:0
(points 2 200 90 200 99))
(connect D9:1 D8:1
(points 2 607 150 616 150))
(connect D18:1 D9:1
(points 4 528 80 550 80 550 130 573 130))
(connect D16:1 D9:2
(points 4 418 80 460 80 460 140 573 140))
(connect D15:1 D9:3
(points 4 318 80 340 80 340 150 573 150))
(connect D4:1 D9:4
(points 4 218 80 240 80 240 160 573 160))
(connect D3:1 D9:5
(points 4 118 80 140 80 140 170 573 170))
(connect D0:1 D10:0
(points 3 59 20 400 20 400 36))
(connect D16:0 D11:0
(points 2 400 90 400 99))
(connect D15:0 D12:0
(points 2 300 90 300 99))
(connect D0:1 D13:0
(points 3 59 20 300 20 300 36))
(connect D12:0 D14:0
(points 2 300 120 300 129))
(connect D13:0 D15:0
(points 2 300 64 300 69))
(connect D10:0 D16:0
(points 2 400 64 400 69))
(connect D0:1 D17:0
(points 3 59 20 510 20 510 36))
(connect D17:0 D18:0
(points 2 510 64 510 69))
(connect D18:0 D19:0
(points 2 510 90 510 99)))
(stackingOrder 1 2 13 10 12 14 4 7 3 6 16 17 19 9 8 18 0 11 15 5))
(numberFormats
(realFormat standard)
(realSigDigits 4)
(realRadixSpec 4)
(integerBase decimal))))

Outcomes