jamminbuddha
Technical User
Hi!
I am working on a macro that presents a user 11 option/radio buttons. Depending on the one they choose, the text associated with that button in the Case options will be sent to the screen.
The closest example I found was in another post showing how Push Buttons work as opposed to radio buttons.
See below:
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
How can I code this so that radio buttons are used instead?
I played around with inserting this code in my own program coding, but not knowing the radio button programming it failed. There also seemed to be some conflict with the declarations in this part of the above code:
Dim optsdialog as UserDialog
ichoice = Dialog(optsdialog)
with my own declarations about my Dialog box. I altered them to correspond but it didn't work.
Below is my own coding for my Dialog box for reference as well. I didn't include my whole code, but can if need be. It is a tad bit messy as I am learning this as I go and have copied and tweaked existing code for my needs.
Begin Dialog UserDialog 185, 52, 280, 174, "Share Aging"
TextBox 95, 5, 51, 13, .freeshrbox
TextBox 95, 19, 51, 13, .tfrdatebox
TextBox 95, 32, 51, 13, .redfeedatebox
TextBox 95, 46, 51, 13, .navpricebox
OptionGroup .OptionGroup1
OptionButton 10, 79, 46, 10, "Purchases", .OptionButton4
OptionButton 10, 95, 60, 10, "Purchases A+", .OptionButton1
OptionButton 10, 110, 60, 10, "Free Side Load", .OptionButton2
OptionButton 10, 130, 45, 10, "Dividends", .OptionButton3
OptionButton 90, 85, 46, 10, "Purchases", .OptionButton5
OptionButton 90, 102, 65, 10, "Free Side Load", .OptionButton6
OptionButton 90, 119, 50, 10, "Dividends", .OptionButton7
OptionButton 180, 80, 80, 11, "Purchases (Liable)", .OptionButton8
OptionButton 180, 97, 95, 11, "Purchases (Not Liable)", .OptionButton9
OptionButton 180, 114, 65, 10, "Free Side Load", .OptionButton10
OptionButton 180, 131, 44, 10, "Dividends", .OptionButton11
TextBox 95, 149, 53, 13, .microbox
OkButton 170, 148, 36, 14
CancelButton 215, 148, 36, 14
GroupBox 5, 65, 74, 80, "A Shares"
Text 28, 154, 54, 8, "Micro Ref # Date"
GroupBox 85, 65, 85, 80, "B Shares"
GroupBox 170, 65, 110, 80, "C Shares"
Text 20, 5, 65, 10, "Adj Free Shares"
Text 18, 21, 65, 8, "Transfer/Purch Date"
Text 19, 49, 65, 8, "NAV Price", .navprice
Text 20, 35, 65, 8, "Red Fee Liable Date"
Picture 181, 12, 77, 39, "C:\Program Files\E!PC\ben 256.bmp", 0
End Dialog
Any guidance that anyone can provide will be greatly appreciated. My searches through this forum and the Extra Help files have not been enough to get me over this roadblock.
Thank you
I am working on a macro that presents a user 11 option/radio buttons. Depending on the one they choose, the text associated with that button in the Case options will be sent to the screen.
The closest example I found was in another post showing how Push Buttons work as opposed to radio buttons.
See below:
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
How can I code this so that radio buttons are used instead?
I played around with inserting this code in my own program coding, but not knowing the radio button programming it failed. There also seemed to be some conflict with the declarations in this part of the above code:
Dim optsdialog as UserDialog
ichoice = Dialog(optsdialog)
with my own declarations about my Dialog box. I altered them to correspond but it didn't work.
Below is my own coding for my Dialog box for reference as well. I didn't include my whole code, but can if need be. It is a tad bit messy as I am learning this as I go and have copied and tweaked existing code for my needs.
Begin Dialog UserDialog 185, 52, 280, 174, "Share Aging"
TextBox 95, 5, 51, 13, .freeshrbox
TextBox 95, 19, 51, 13, .tfrdatebox
TextBox 95, 32, 51, 13, .redfeedatebox
TextBox 95, 46, 51, 13, .navpricebox
OptionGroup .OptionGroup1
OptionButton 10, 79, 46, 10, "Purchases", .OptionButton4
OptionButton 10, 95, 60, 10, "Purchases A+", .OptionButton1
OptionButton 10, 110, 60, 10, "Free Side Load", .OptionButton2
OptionButton 10, 130, 45, 10, "Dividends", .OptionButton3
OptionButton 90, 85, 46, 10, "Purchases", .OptionButton5
OptionButton 90, 102, 65, 10, "Free Side Load", .OptionButton6
OptionButton 90, 119, 50, 10, "Dividends", .OptionButton7
OptionButton 180, 80, 80, 11, "Purchases (Liable)", .OptionButton8
OptionButton 180, 97, 95, 11, "Purchases (Not Liable)", .OptionButton9
OptionButton 180, 114, 65, 10, "Free Side Load", .OptionButton10
OptionButton 180, 131, 44, 10, "Dividends", .OptionButton11
TextBox 95, 149, 53, 13, .microbox
OkButton 170, 148, 36, 14
CancelButton 215, 148, 36, 14
GroupBox 5, 65, 74, 80, "A Shares"
Text 28, 154, 54, 8, "Micro Ref # Date"
GroupBox 85, 65, 85, 80, "B Shares"
GroupBox 170, 65, 110, 80, "C Shares"
Text 20, 5, 65, 10, "Adj Free Shares"
Text 18, 21, 65, 8, "Transfer/Purch Date"
Text 19, 49, 65, 8, "NAV Price", .navprice
Text 20, 35, 65, 8, "Red Fee Liable Date"
Picture 181, 12, 77, 39, "C:\Program Files\E!PC\ben 256.bmp", 0
End Dialog
Any guidance that anyone can provide will be greatly appreciated. My searches through this forum and the Extra Help files have not been enough to get me over this roadblock.
Thank you