molemanryan
Technical User
I am trying to create a drop down list with the DropComboBox function with Attachmate. What I am trying to do is list all 50 states along with their 2 digit state abbreviation. Like District of Columbia is DC Virginia is VA and so on. The user will select one of these states and the corresponding 2 letter abbreviation will be sent to the screen. This is what I have so far:
Begin Dialog UserDialog 180, 95, "Select a State"
ButtonGroup .ButtonGroup1
Text 9, 3, 69, 13, "States:", .Text1
DropComboBox 9, 17, 111, 41, "Alaska AK"+Chr$(9)+"Arizona AZ"+Chr$(9)+"Arkansas AR", .ComboBox1
OKButton 131, 8, 42, 13
CancelButton 131, 27, 42, 13
End Dialog
Dim mydialogbox As UserDialog
Dialog mydialogbox
if DropComboBox = "Alaska AK" then
sess0.screen.sendkeys("AK")
end if
Couple of questions...how do I verify or check what was chosen with this function? I am pretty sure it's not the DropComboBox function holding the value, it seems it would be in an array. I tried using it as:
dim choices as string
Begin Dialog UserDialog 180, 95, "Select a State"
choices() = "Alaska AK"+Chr$(9)+"Arizona AZ"+Chr$(9)+"Arkansas AR"
ButtonGroup .ButtonGroup1
Text 9, 3, 69, 13, "States:", .Text1
DropComboBox 9, 17, 111, 41, choices(), .comboBox1
OKButton 131, 8, 42, 13
CancelButton 131, 27, 42, 13
End Dialog
Dim mydialogbox As UserDialog
Dialog mydialogbox
if choices(1) = "Alaska AK" then
sess0.screen.sendkeys("AK")
end if
This didn't work as it is referencing the number element like choices(1) would be Alaska...but I can't for the life of me figure it out. Your help is greatly appreciated!
Thank you
Ryan
Begin Dialog UserDialog 180, 95, "Select a State"
ButtonGroup .ButtonGroup1
Text 9, 3, 69, 13, "States:", .Text1
DropComboBox 9, 17, 111, 41, "Alaska AK"+Chr$(9)+"Arizona AZ"+Chr$(9)+"Arkansas AR", .ComboBox1
OKButton 131, 8, 42, 13
CancelButton 131, 27, 42, 13
End Dialog
Dim mydialogbox As UserDialog
Dialog mydialogbox
if DropComboBox = "Alaska AK" then
sess0.screen.sendkeys("AK")
end if
Couple of questions...how do I verify or check what was chosen with this function? I am pretty sure it's not the DropComboBox function holding the value, it seems it would be in an array. I tried using it as:
dim choices as string
Begin Dialog UserDialog 180, 95, "Select a State"
choices() = "Alaska AK"+Chr$(9)+"Arizona AZ"+Chr$(9)+"Arkansas AR"
ButtonGroup .ButtonGroup1
Text 9, 3, 69, 13, "States:", .Text1
DropComboBox 9, 17, 111, 41, choices(), .comboBox1
OKButton 131, 8, 42, 13
CancelButton 131, 27, 42, 13
End Dialog
Dim mydialogbox As UserDialog
Dialog mydialogbox
if choices(1) = "Alaska AK" then
sess0.screen.sendkeys("AK")
end if
This didn't work as it is referencing the number element like choices(1) would be Alaska...but I can't for the life of me figure it out. Your help is greatly appreciated!
Thank you
Ryan