VoodooWillie
Technical User
I am new to writing Aspect scripts (started last week and learned or utilized parts of scripts from this forum) and may be missing something obvious, but the script I am working on is for logging into switch using a telnet session. The only thing that ever changes is the switch number I start on.
The dialog box comes up and I input the requested info and that's as far as it gets. The dialog box disappears and none of the info I entered is populated on the terminal.
Any assistance would be greatly appreciated.
Thanks in advance,
VW
Script is as follows:
#define TRUE 1
proc main
string uName, pWord, cOmc
integer Event
integer OMC = 4
dialogbox 0 8 20 264 169 3 "Automated Log In"
editbox 1 104 23 86 11 uName 15
editbox 2 105 44 86 11 pWord 15 MASKED
text 3 64 24 34 11 "User ID:" right
text 4 66 44 34 11 "Password:" right
text 5 109 69 46 11 "Choose OMC:" left
radiogroup 20 OMC
radiobutton 6 98 87 66 11 "Switch 1"
radiobutton 7 98 98 66 11 "Switch 2"
radiobutton 8 98 110 66 11 "Switch 3"
radiobutton 9 98 122 66 11 "Switch 4"
endgroup
pushbutton 10 38 151 40 13 "Ok" OK Default
pushbutton 11 186 151 40 13 "Cancel" CANCEL
enddialog
while TRUE
dlgevent 0 Event
switch Event
case 15
login(uName, pWord, cOMC)
;Evaluate radio group state
if OMC == 6
cOMC="1^M"
endif
if OMC == 7
cOMC="2^M"
endif
if OMC == 8
cOMC="3^M"
endif
if OMC == 9
cOMC="4^M"
endif
endcase
case -1
case 16
exitwhile
endcase
endswitch
endwhile
endproc
proc login
param string uName, pWord, cOMC
string sUserName, sPassWord, OMC
;waitfor "login: "
strfmt sUserName "%s^M" uName
transmit sUserName
waitfor "Password: "
strfmt sPassWord "%s^M" pWord
transmit sPassWord
waitfor "Please Enter Selection: >"
transmit "4^M"
waitfor "Please Enter Selection: >"
strfmt OMC "%s^M" cOMC
transmit OMC
waitfor ">"
transmit "CLI^M"
endproc
The dialog box comes up and I input the requested info and that's as far as it gets. The dialog box disappears and none of the info I entered is populated on the terminal.
Any assistance would be greatly appreciated.
Thanks in advance,
VW
Script is as follows:
#define TRUE 1
proc main
string uName, pWord, cOmc
integer Event
integer OMC = 4
dialogbox 0 8 20 264 169 3 "Automated Log In"
editbox 1 104 23 86 11 uName 15
editbox 2 105 44 86 11 pWord 15 MASKED
text 3 64 24 34 11 "User ID:" right
text 4 66 44 34 11 "Password:" right
text 5 109 69 46 11 "Choose OMC:" left
radiogroup 20 OMC
radiobutton 6 98 87 66 11 "Switch 1"
radiobutton 7 98 98 66 11 "Switch 2"
radiobutton 8 98 110 66 11 "Switch 3"
radiobutton 9 98 122 66 11 "Switch 4"
endgroup
pushbutton 10 38 151 40 13 "Ok" OK Default
pushbutton 11 186 151 40 13 "Cancel" CANCEL
enddialog
while TRUE
dlgevent 0 Event
switch Event
case 15
login(uName, pWord, cOMC)
;Evaluate radio group state
if OMC == 6
cOMC="1^M"
endif
if OMC == 7
cOMC="2^M"
endif
if OMC == 8
cOMC="3^M"
endif
if OMC == 9
cOMC="4^M"
endif
endcase
case -1
case 16
exitwhile
endcase
endswitch
endwhile
endproc
proc login
param string uName, pWord, cOMC
string sUserName, sPassWord, OMC
;waitfor "login: "
strfmt sUserName "%s^M" uName
transmit sUserName
waitfor "Password: "
strfmt sPassWord "%s^M" pWord
transmit sPassWord
waitfor "Please Enter Selection: >"
transmit "4^M"
waitfor "Please Enter Selection: >"
strfmt OMC "%s^M" cOMC
transmit OMC
waitfor ">"
transmit "CLI^M"
endproc