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!

First button strange behaviour 2

Status
Not open for further replies.

Echilon

Programmer
Feb 22, 2007
54
GB
I have several macros which create a dialog, and I'm using the same structure for each one, just different text. The first button on each one is sending the text,l but the cursor's disappearing from the terminal until I click, whereas with all other buttons, the text is sent and the cursor blinks at the last line of text. Even if I change 'Case 1' to send just one letter, the cursor disappears.

My code is:


Sub Main

Dim System As Object
Dim Sess As Object
Set System = CreateObject("EXTRA.System")
Set Sess = System.ActiveSession
Begin Dialog UserDialog 23, 26, 86, 62, "New DACs"
ButtonGroup .AllButtons
PushButton 0, 0, 84, 18, "New DACs Required"
PushButton 0, 20, 84, 18, "Double DACs"
PushButton 0, 40, 84, 20, "B1 Unsuitable"
End Dialog

Dim optsdialog as UserDialog
ichoice = Dialog(optsdialog)

Select Case ichoice
Case 1
Sess.Screen.SendKeys("Some text")
Case 2
Sess.Screen.SendKeys("Some text")
Case 3
Sess.Screen.SendKeys("Some text")
End Select
End Sub



Regardless of the text I send, the first button always makes the cursor disappear, which makes me think there's a problem with the syntax somewhere. Thanks for any help.
 
I don't see any problems with your code. When you select Tools -> Your Macro, the popup with the buttons becomes the top-most window. Therefore, your emulator loses focus, which is why the cursor is "disappearing."

Code:
Begin Dialog UserDialog 23, [COLOR=red]226[/color], 86, 62, "New DACs"

Consider using .PutString
Code:
Sess.Screen.PutString "A String", row_num, col_num
 
PutString won't work because there's a dynamic amount of text on the screen. The second and subsequent buttons work straight from the quickpad, but the first one causes the cursor to lose focus.
 
When you click the first button and the cursor disappears, does anything print to the terminal? Your code runs perfectly on my machine.
 
Have you tried using a MoveRelative to see if it brings back the cursor?

Sess.Screen.MoveRelative 0,0

 
Thanks Skie, that worked perfectly. One less mouse click for me :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top